operand = ["+", "-", "*"]
src = [x if x in operand else int(x) for x in  input().split(" ")]
stack = []

for s in src:
    if isinstance(s, int):
        stack.append(s)
    elif s == "+":
       b, a = stack.pop(), stack.pop()
       stack.append(a+b)

    elif s == "-":
        b, a = stack.pop(), stack.pop()
        stack.append(a-b)
    elif s == "*":
        b, a = stack.pop(), stack.pop()
        stack.append(a*b)

print(stack[0]) operand = ["+", "-", "*"] operand ["+", "-", "*"] "+" "-" "*" x if x in operand else int(x) for x in  input().split(" ") for x in  input().split(" ") x input().split(" ") ().split () input split " " for x in  input().split(" ") x if x in operand else int(x) x in operand x operand x int(x) int x src = [x if x in operand else int(x) for x in  input().split(" ")] src [x if x in operand else int(x) for x in  input().split(" ")] stack = [] stack [] for s in src:
    if isinstance(s, int):
        stack.append(s)
    elif s == "+":
       b, a = stack.pop(), stack.pop()
       stack.append(a+b)

    elif s == "-":
        b, a = stack.pop(), stack.pop()
        stack.append(a-b)
    elif s == "*":
        b, a = stack.pop(), stack.pop()
        stack.append(a*b) s src if isinstance(s, int):
        stack.append(s)
    elif s == "+":
       b, a = stack.pop(), stack.pop()
       stack.append(a+b)

    elif s == "-":
        b, a = stack.pop(), stack.pop()
        stack.append(a-b)
    elif s == "*":
        b, a = stack.pop(), stack.pop()
        stack.append(a*b) isinstance(s, int) isinstance s int stack.append(s) stack.append stack append s elif s == "+":
       b, a = stack.pop(), stack.pop()
       stack.append(a+b)

     s == "+" s "+" 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 s == "-":
        b, a = stack.pop(), stack.pop()
        stack.append(a-b)
     s == "-" s "-" 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 s == "*":
        b, a = stack.pop(), stack.pop()
        stack.append(a*b) s == "*" s "*" 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 print(stack[0]) print stack[0] stack 0 b, a = stack.pop(), stack.pop() stack.pop() b operand = ["+", "-", "*"] ["+", "-", "*"] operand b, a = stack.pop(), stack.pop() stack.pop() b a = stack.pop(), stack.pop() stack.pop() a src = [x if x in operand else int(x) for x in  input().split(" ")] [x if x in operand else int(x) for x in  input().split(" ")] src stack = [] [] stack a = stack.pop(), stack.pop() stack.pop() a b, a = stack.pop(), stack.pop() stack.pop() b a = stack.pop(), stack.pop() stack.pop() a
operand = ["+", "-", "*"]
src = [x if x in operand else int(x) for x in  input().split(" ")]
stack = []

for s in src:
    if isinstance(s, int):
        stack.append(s)
    elif s == "+":
       b, a = stack.pop(), stack.pop()
       stack.append(a+b)

    elif s == "-":
        b, a = stack.pop(), stack.pop()
        stack.append(a-b)
    elif s == "*":
        b, a = stack.pop(), stack.pop()
        stack.append(a*b)

print(stack[0])