# Arup Guha
# 11/6/2020
# Solution for CIS 3362 Homework #6 Problem #7

from sys import stdin

# Public keys.
n = 5959543795627426174320202010482251983
e = 236234523452345345234523452345243447

# Returns (base**exp) % mod, efficiently.
def fastmodexpo(base,exp,mod):

    # Base case.
    if exp == 0:
        return 1

    # Speed up here with even exponent.
    if exp%2 == 0:
        tmp = fastmodexpo(base,exp//2,mod)
        return (tmp*tmp)%mod

    # Odd case, must just do the regular ways.
    return (base*fastmodexpo(base,exp-1,mod))%mod

# Convert line to a number in Radix-64.
def linetonum(line):

    # Just use Horner's Method here, shifting by 6 bits each time.
    res = 0
    for i in range(len(line)):
        res = 64*res + chartonum(line[i])

    return res

# Converts from a character to a number.
def chartonum(c):

    # Upper case letters 0 - 25
    if c >= 'A' and c <= 'Z':
        return ord(c) - ord('A')

    # Lower case letters 26 to 51
    if c >= 'a' and c <= 'z':
        return ord(c) - ord('a') + 26

    # Digits 52 to 61
    if c >= '0' and c <= '9':
        return ord(c) - ord('0') + 52

    # Our special characters.
    if c == '+':
        return 62

    return 63

def main():

    # Read each line.
    for line in stdin:

        # Convert to int.
        line = line.strip()
        plainval = linetonum(line)

        # Exponentiate and output.
        print(fastmodexpo(plainval, e, n))
# Go
main()
