operators = ['+', '-', '*', '/']
stack = list(input().split())
# stack = list(open('input.txt').readline().split())


def calc(ope):
    c = stack.pop()
    a = c if c not in operators else calc(c)
    c = stack.pop()
    b = c if c not in operators else calc(c)
    return str(eval(b+ope+a))

print(calc(stack.pop())) operators = ['+', '-', '*', '/'] operators ['+', '-', '*', '/'] '+' '-' '*' '/' stack = list(input().split()) stack list(input().split()) list input().split() ().split () input split def calc(ope):
    c = stack.pop()
    a = c if c not in operators else calc(c)
    c = stack.pop()
    b = c if c not in operators else calc(c)
    return str(eval(b+ope+a)) calc c = stack.pop() c stack.pop() stack.pop stack pop a = c if c not in operators else calc(c) a c if c not in operators else calc(c) c not in operators c operators c calc(c) calc c c = stack.pop() c stack.pop() stack.pop stack pop b = c if c not in operators else calc(c) b c if c not in operators else calc(c) c not in operators c operators c calc(c) calc c return str(eval(b+ope+a)) str(eval(b+ope+a)) str eval(b+ope+a) eval b+ope+a b+ope b ope a ope ope print(calc(stack.pop())) print calc(stack.pop()) calc stack.pop() stack.pop stack pop operators = ['+', '-', '*', '/'] ['+', '-', '*', '/'] operators def calc(ope):
    c = stack.pop()
    a = c if c not in operators else calc(c)
    c = stack.pop()
    b = c if c not in operators else calc(c)
    return str(eval(b+ope+a)) def calc(ope):
    c = stack.pop()
    a = c if c not in operators else calc(c)
    c = stack.pop()
    b = c if c not in operators else calc(c)
    return str(eval(b+ope+a)) calc stack = list(input().split()) list(input().split()) stack
operators = ['+', '-', '*', '/']
stack = list(input().split())
# stack = list(open('input.txt').readline().split())


def calc(ope):
    c = stack.pop()
    a = c if c not in operators else calc(c)
    c = stack.pop()
    b = c if c not in operators else calc(c)
    return str(eval(b+ope+a))

print(calc(stack.pop()))