data = input().split()
operator = ["+", "*", "-"]
stack = []
for x in data:
    if x in operator:
        a = stack.pop()
        b = stack.pop()
        stack.append(str(eval(b + x + a)))
    else:
        stack.append(x)
print(stack[0]) data = input().split() data input().split() ().split () input split operator = ["+", "*", "-"] operator ["+", "*", "-"] "+" "*" "-" stack = [] stack [] for x in data:
    if x in operator:
        a = stack.pop()
        b = stack.pop()
        stack.append(str(eval(b + x + a)))
    else:
        stack.append(x) x data if x in operator:
        a = stack.pop()
        b = stack.pop()
        stack.append(str(eval(b + x + a)))
    else:
        stack.append(x) x in operator x operator a = stack.pop() a stack.pop() stack.pop stack pop b = stack.pop() b stack.pop() stack.pop stack pop stack.append(str(eval(b + x + a))) stack.append stack append str(eval(b + x + a)) str eval(b + x + a) eval b + x + a b + x b x a stack.append(x) stack.append stack append x print(stack[0]) print stack[0] stack 0 stack = [] [] stack operator = ["+", "*", "-"] ["+", "*", "-"] operator a = stack.pop() stack.pop() a data = input().split() input().split() data b = stack.pop() stack.pop() b
data = input().split()
operator = ["+", "*", "-"]
stack = []
for x in data:
    if x in operator:
        a = stack.pop()
        b = stack.pop()
        stack.append(str(eval(b + x + a)))
    else:
        stack.append(x)
print(stack[0])