// Arup Guha
// 11/6/2020
// Java Solution to CIS 3362 Homework 6, Problem #7

import java.math.*;
import java.util.*;

public class problem7 {

	// Public keys.
	final public static BigInteger n = new BigInteger("5959543795627426174320202010482251983");
	final public static BigInteger e = new BigInteger("236234523452345345234523452345243447");

	// For Radix 64.
	final public static BigInteger BASE = new BigInteger("64");

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		
		// Process each line...just call modPow!
		while (stdin.hasNext()) {
			BigInteger plain = lineToNum(stdin.nextLine());
			System.out.println(plain.modPow(e, n));
		}
	}
	
	// Converts a line of Radix 64 characters to a BigInteger via Horner's Method.
	public static BigInteger lineToNum(String line) {
		BigInteger res = new BigInteger("0");
		for (int i=0; i<line.length(); i++) {
			res = res.multiply(BASE);
			res = res.add(convert(line.charAt(i)));
		}
		return res;
	}
	
	// Returns the numeric Radix-64 value of c as a BigInteger.
	public static BigInteger convert(char c) {
	
		// Upper case letters.
		if (c >= 'A' && c <= 'Z')
			return new BigInteger(""+(c-'A'));
			
		// Lower case letters.
		if (c >= 'a' && c <= 'z')
			return new BigInteger(""+(c-'a'+26));
			
		// Digits.
		if (c >= '0' && c <= '9')
			return new BigInteger(""+(c-'0'+52));
			
		// Special characters.
		if (c == '+') return new BigInteger("62");
		return new BigInteger("63");
	}
	
}