fig = input()
symbol = fig.split(' ')
stack = []

for i in symbol:
    try:
        stack.append(int(i))
    except ValueError:
       if i == "+": stack.append(stack.pop()+stack.pop())
       elif i == "-": stack.append(-(stack.pop()-stack.pop()))
       elif i == "*": stack.append(stack.pop()*stack.pop())

print(stack[0]) fig = input() fig input() input symbol = fig.split(' ') symbol fig.split(' ') fig.split fig split ' ' stack = [] stack [] for i in symbol:
    try:
        stack.append(int(i))
    except ValueError:
       if i == "+": stack.append(stack.pop()+stack.pop())
       elif i == "-": stack.append(-(stack.pop()-stack.pop()))
       elif i == "*": stack.append(stack.pop()*stack.pop()) i symbol try:
        stack.append(int(i))
    except ValueError:
       if i == "+": stack.append(stack.pop()+stack.pop())
       elif i == "-": stack.append(-(stack.pop()-stack.pop()))
       elif i == "*": stack.append(stack.pop()*stack.pop()) except ValueError:
       if i == "+": stack.append(stack.pop()+stack.pop())
       elif i == "-": stack.append(-(stack.pop()-stack.pop()))
       elif i == "*": stack.append(stack.pop()*stack.pop()) if i == "+": stack.append(stack.pop()+stack.pop())
       elif i == "-": stack.append(-(stack.pop()-stack.pop()))
       elif i == "*": stack.append(stack.pop()*stack.pop()) i == "+" i "+" elif i == "-": stack.append(-(stack.pop()-stack.pop()))
        i == "-" i "-" elif i == "*": stack.append(stack.pop()*stack i == "*" i "*" stack.append(int(i)) stack.append stack append int(i) int i print(stack[0]) print stack[0] stack 0 stack = [] [] stack symbol = fig.split(' ') fig.split(' ') symbol fig = input() input() fig
fig = input()
symbol = fig.split(' ')
stack = []

for i in symbol:
    try:
        stack.append(int(i))
    except ValueError:
       if i == "+": stack.append(stack.pop()+stack.pop())
       elif i == "-": stack.append(-(stack.pop()-stack.pop()))
       elif i == "*": stack.append(stack.pop()*stack.pop())

print(stack[0])