stack = []

for op in input().split():
    if op in '+-*':
        b = stack.pop()
        a = stack.pop()
        stack.append(str(eval(a+op+b)))
    else:
        stack.append(op)

print(''.join(stack)) stack = [] stack [] for op in input().split():
    if op in '+-*':
        b = stack.pop()
        a = stack.pop()
        stack.append(str(eval(a+op+b)))
    else:
        stack.append(op) op input().split() ().split () input split if op in '+-*':
        b = stack.pop()
        a = stack.pop()
        stack.append(str(eval(a+op+b)))
    else:
        stack.append(op) op in '+-*' op '+-*' b = stack.pop() b stack.pop() stack.pop stack pop a = stack.pop() a stack.pop() stack.pop stack pop stack.append(str(eval(a+op+b))) stack.append stack append str(eval(a+op+b)) str eval(a+op+b) eval a+op+b a+op a op b stack.append(op) stack.append stack append op print(''.join(stack)) print ''.join(stack) ''.join '' join stack b = stack.pop() stack.pop() b a = stack.pop() stack.pop() a stack = [] [] stack
stack = []

for op in input().split():
    if op in '+-*':
        b = stack.pop()
        a = stack.pop()
        stack.append(str(eval(a+op+b)))
    else:
        stack.append(op)

print(''.join(stack))
