import operator

func = {'+':operator.add, '-':operator.sub, '*':operator.mul}

stack  = []
for symbol in input().split():
    if symbol.isdigit():
        stack.append(int(symbol))
    else:
        a = stack.pop()
        b = stack.pop()
        stack.append(func[symbol](b, a))
        
print(stack[0]) import operator operator func = {'+':operator.add, '-':operator.sub, '*':operator.mul} func {'+':operator.add, '-':operator.sub, '*':operator.mul} '+' '+' operator.add operator add '-' '-' operator.sub operator sub '*' '*' operator.mul operator mul stack  = [] stack [] for symbol in input().split():
    if symbol.isdigit():
        stack.append(int(symbol))
    else:
        a = stack.pop()
        b = stack.pop()
        stack.append(func[symbol](b, a))
         symbol input().split() ().split () input split if symbol.isdigit():
        stack.append(int(symbol))
    else:
        a = stack.pop()
        b = stack.pop()
        stack.append(func[symbol](b, a))
         symbol.isdigit() symbol.isdigit symbol isdigit stack.append(int(symbol)) stack.append stack append int(symbol) int symbol a = stack.pop() a stack.pop() stack.pop stack pop b = stack.pop() b stack.pop() stack.pop stack pop stack.append(func[symbol](b, a)) stack.append stack append func[symbol](b, a) [symbol] func symbol b a print(stack[0]) print stack[0] stack 0 a = stack.pop() stack.pop() a func = {'+':operator.add, '-':operator.sub, '*':operator.mul} {'+':operator.add, '-':operator.sub, '*':operator.mul} func stack  = [] [] stack b = stack.pop() stack.pop() b
import operator

func = {'+':operator.add, '-':operator.sub, '*':operator.mul}

stack  = []
for symbol in input().split():
    if symbol.isdigit():
        stack.append(int(symbol))
    else:
        a = stack.pop()
        b = stack.pop()
        stack.append(func[symbol](b, a))
        
print(stack[0])