ope = list(input().split())

stack = []

for o in ope:
    if o == '+':
        b, a = stack.pop(), stack.pop()
        stack.append(a + b)
    elif o == '-':
        b, a = stack.pop(), stack.pop()
        stack.append(a - b)
    elif o == '*':
        b, a = stack.pop(), stack.pop()
        stack.append(a * b)
    else:
        stack.append(int(o))

print(stack[0])
 ope = list(input().split()) ope list(input().split()) list input().split() ().split () input split stack = [] stack [] for o in ope:
    if o == '+':
        b, a = stack.pop(), stack.pop()
        stack.append(a + b)
    elif o == '-':
        b, a = stack.pop(), stack.pop()
        stack.append(a - b)
    elif o == '*':
        b, a = stack.pop(), stack.pop()
        stack.append(a * b)
    else:
        stack.append(int(o)) o ope if o == '+':
        b, a = stack.pop(), stack.pop()
        stack.append(a + b)
    elif o == '-':
        b, a = stack.pop(), stack.pop()
        stack.append(a - b)
    elif o == '*':
        b, a = stack.pop(), stack.pop()
        stack.append(a * b)
    else:
        stack.append(int(o)) o == '+' o '+' b, a = stack.pop(), stack.pop() b stack.pop() stack.pop stack pop a stack.pop() stack.pop stack pop stack.append(a + b) stack.append stack append a + b a b elif o == '-':
        b, a = stack.pop(), stack.pop()
        stack.append(a - b)
     o == '-' o '-' b, a = stack.pop(), stack.pop() b stack.pop() stack.pop stack pop a stack.pop() stack.pop stack pop stack.append(a - b) stack.append stack append a - b a b elif o == '*':
        b, a = stack.pop(), stack.pop()
        stack.append(a * b)
     o == '*' o '*' b, a = stack.pop(), stack.pop() b stack.pop() stack.pop stack pop a stack.pop() stack.pop stack pop stack.append(a * b) stack.append stack append a * b a b stack.append(int(o)) stack.append stack append int(o) int o print(stack[0]) print stack[0] stack 0 a = stack.pop(), stack.pop() stack.pop() a stack = [] [] stack b, a = stack.pop(), stack.pop() stack.pop() b a = stack.pop(), stack.pop() stack.pop() a ope = list(input().split()) list(input().split()) ope a = stack.pop(), stack.pop() stack.pop() a b, a = stack.pop(), stack.pop() stack.pop() b b, a = stack.pop(), stack.pop() stack.pop() b
ope = list(input().split())

stack = []

for o in ope:
    if o == '+':
        b, a = stack.pop(), stack.pop()
        stack.append(a + b)
    elif o == '-':
        b, a = stack.pop(), stack.pop()
        stack.append(a - b)
    elif o == '*':
        b, a = stack.pop(), stack.pop()
        stack.append(a * b)
    else:
        stack.append(int(o))

print(stack[0])

