ops = [op for op in input().split(" ")]
stack = []
for op in ops:
    if op == "+":
        stack = stack[:-2]+[stack[-2]+stack[-1]]
    elif op == "-":
        stack = stack[:-2]+[stack[-2]-stack[-1]]
    elif op == "*":
        stack = stack[:-2]+[stack[-2]*stack[-1]]
    else:
        stack.append(int(op))
print(stack[0]) op for op in input().split(" ") for op in input().split(" ") op input().split(" ") ().split () input split " " for op in input().split(" ") op ops = [op for op in input().split(" ")] ops [op for op in input().split(" ")] stack = [] stack [] for op in ops:
    if op == "+":
        stack = stack[:-2]+[stack[-2]+stack[-1]]
    elif op == "-":
        stack = stack[:-2]+[stack[-2]-stack[-1]]
    elif op == "*":
        stack = stack[:-2]+[stack[-2]*stack[-1]]
    else:
        stack.append(int(op)) op ops if op == "+":
        stack = stack[:-2]+[stack[-2]+stack[-1]]
    elif op == "-":
        stack = stack[:-2]+[stack[-2]-stack[-1]]
    elif op == "*":
        stack = stack[:-2]+[stack[-2]*stack[-1]]
    else:
        stack.append(int(op)) op == "+" op "+" stack = stack[:-2]+[stack[-2]+stack[-1]] stack stack[:-2]+[stack[-2]+stack[-1]] stack[:-2] stack :-2 -2 [stack[-2]+stack[-1]] stack[-2]+stack[-1] stack[-2] stack -2 stack[-1] stack -1 elif op == "-":
        stack = stack[:-2]+[stack[-2]-stack[-1]]
     op == "-" op "-" stack = stack[:-2]+[stack[-2]-stack[-1]] stack stack[:-2]+[stack[-2]-stack[-1]] stack[:-2] stack :-2 -2 [stack[-2]-stack[-1]] stack[-2]-stack[-1] stack[-2] stack -2 stack[-1] stack -1 elif op == "*":
        stack = stack[:-2]+[stack[-2]*stack[-1]]
     op == "*" op "*" stack = stack[:-2]+[stack[-2]*stack[-1]] stack stack[:-2]+[stack[-2]*stack[-1]] stack[:-2] stack :-2 -2 [stack[-2]*stack[-1]] stack[-2]*stack[-1] stack[-2] stack -2 stack[-1] stack -1 stack.append(int(op)) stack.append stack append int(op) int op print(stack[0]) print stack[0] stack 0 stack = [] [] stack ops = [op for op in input().split(" ")] [op for op in input().split(" ")] ops stack = stack[:-2]+[stack[-2]+stack[-1]] stack[:-2]+[stack[-2]+stack[-1]] stack stack = stack[:-2]+[stack[-2]*stack[-1]] stack[:-2]+[stack[-2]*stack[-1]] stack stack = stack[:-2]+[stack[-2]-stack[-1]] stack[:-2]+[stack[-2]-stack[-1]] stack
ops = [op for op in input().split(" ")]
stack = []
for op in ops:
    if op == "+":
        stack = stack[:-2]+[stack[-2]+stack[-1]]
    elif op == "-":
        stack = stack[:-2]+[stack[-2]-stack[-1]]
    elif op == "*":
        stack = stack[:-2]+[stack[-2]*stack[-1]]
    else:
        stack.append(int(op))
print(stack[0])