from math import factorial


def fact(a):
    return factorial(a)


def root(a):
    return a ** (1/2)


def square(a):
    return a ** 2


def cube(a):
    return a ** 3


commands = [
    {'match':'root', 'func': root },
    {'match':'!',    'func': fact },
    {'match':'²',    'func': square },
    {'match':'³',    'func': cube },
]

input_command = input()

for command in commands:
    if command["match"] in input_command:
        val = int(input_command.strip(command["match"]))
        print(command["func"](val))
        break 
