array = input().split()
stack = []

while True:
    if len(array) == 0: break
    e = array.pop(0)
    if e.isdigit():
        stack.append(e)
    else:
        num1 = stack.pop()
        num2 = stack.pop()
        stack.append(str(eval(num2 + e + num1)))

print(stack[0]) array = input().split() array input().split() ().split () input split stack = [] stack [] while True:
    if len(array) == 0: break
    e = array.pop(0)
    if e.isdigit():
        stack.append(e)
    else:
        num1 = stack.pop()
        num2 = stack.pop()
        stack.append(str(eval(num2 + e + num1))) True if len(array) == 0: break
     len(array) == 0 len(array) len array 0 e = array.pop(0) e array.pop(0) array.pop array pop 0 if e.isdigit():
        stack.append(e)
    else:
        num1 = stack.pop()
        num2 = stack.pop()
        stack.append(str(eval(num2 + e + num1))) e.isdigit() e.isdigit e isdigit stack.append(e) stack.append stack append e num1 = stack.pop() num1 stack.pop() stack.pop stack pop num2 = stack.pop() num2 stack.pop() stack.pop stack pop stack.append(str(eval(num2 + e + num1))) stack.append stack append str(eval(num2 + e + num1)) str eval(num2 + e + num1) eval num2 + e + num1 num2 + e num2 e num1 print(stack[0]) print stack[0] stack 0 e = array.pop(0) array.pop(0) e num2 = stack.pop() stack.pop() num2 array = input().split() input().split() array num1 = stack.pop() stack.pop() num1 stack = [] [] stack
array = input().split()
stack = []

while True:
    if len(array) == 0: break
    e = array.pop(0)
    if e.isdigit():
        stack.append(e)
    else:
        num1 = stack.pop()
        num2 = stack.pop()
        stack.append(str(eval(num2 + e + num1)))

print(stack[0])