A = input().split()
stack = []
for s in A:
    if s.isdigit():
        stack.append(int(s))
    else:
        stack.append(eval('{2}{1}{0}'.format(stack.pop(), s, stack.pop())))
print(stack[0]) A = input().split() A input().split() ().split () input split stack = [] stack [] for s in A:
    if s.isdigit():
        stack.append(int(s))
    else:
        stack.append(eval('{2}{1}{0}'.format(stack.pop(), s, stack.pop()))) s A if s.isdigit():
        stack.append(int(s))
    else:
        stack.append(eval('{2}{1}{0}'.format(stack.pop(), s, stack.pop()))) s.isdigit() s.isdigit s isdigit stack.append(int(s)) stack.append stack append int(s) int s stack.append(eval('{2}{1}{0}'.format(stack.pop(), s, stack.pop()))) stack.append stack append eval('{2}{1}{0}'.format(stack.pop(), s, stack.pop())) eval '{2}{1}{0}'.format(stack.pop(), s, stack.pop()) '{2}{1}{0}'.format '{2}{1}{0}' format stack.pop() stack.pop stack pop s stack.pop() stack.pop stack pop print(stack[0]) print stack[0] stack 0 A = input().split() input().split() A stack = [] [] stack
A = input().split()
stack = []
for s in A:
    if s.isdigit():
        stack.append(int(s))
    else:
        stack.append(eval('{2}{1}{0}'.format(stack.pop(), s, stack.pop())))
print(stack[0])
