calc = input().split(" ")

nums = []
subTotal = 0

for i in range(len(calc)):
    if calc[i].isdigit():
        nums.append(int(calc[i]))
    else:
        b = nums.pop()
        a = nums.pop()

        if calc[i] == "+":
            subTotal = a + b
        elif calc[i] == "-":
            subTotal = a - b
        elif calc[i] == "*":
            subTotal = a * b
        
        nums.append(subTotal)

print(" ".join(map(str,nums))) calc = input().split(" ") calc input().split(" ") ().split () input split " " nums = [] nums [] subTotal = 0 subTotal 0 for i in range(len(calc)):
    if calc[i].isdigit():
        nums.append(int(calc[i]))
    else:
        b = nums.pop()
        a = nums.pop()

        if calc[i] == "+":
            subTotal = a + b
        elif calc[i] == "-":
            subTotal = a - b
        elif calc[i] == "*":
            subTotal = a * b
        
        nums.append(subTotal) i range(len(calc)) range len(calc) len calc if calc[i].isdigit():
        nums.append(int(calc[i]))
    else:
        b = nums.pop()
        a = nums.pop()

        if calc[i] == "+":
            subTotal = a + b
        elif calc[i] == "-":
            subTotal = a - b
        elif calc[i] == "*":
            subTotal = a * b
        
        nums.append(subTotal) calc[i].isdigit() [i].isdigit [i] calc i isdigit nums.append(int(calc[i])) nums.append nums append int(calc[i]) int calc[i] calc i b = nums.pop() b nums.pop() nums.pop nums pop a = nums.pop() a nums.pop() nums.pop nums pop if calc[i] == "+":
            subTotal = a + b
        elif calc[i] == "-":
            subTotal = a - b
        elif calc[i] == "*":
            subTotal = a * b
        
         calc[i] == "+" calc[i] calc i "+" subTotal = a + b subTotal a + b a b elif calc[i] == "-":
            subTotal = a - b
         calc[i] == "-" calc[i] calc i "-" subTotal = a - b subTotal a - b a b elif calc[i] == "*":
            subTotal = a * b
        
         calc[i] == "*" calc[i] calc i "*" subTotal = a * b subTotal a * b a b nums.append(subTotal) nums.append nums append subTotal print(" ".join(map(str,nums))) print " ".join(map(str,nums)) " ".join " " join map(str,nums) map str nums a = nums.pop() nums.pop() a nums = [] [] nums subTotal = a - b a - b subTotal subTotal = 0 0 subTotal b = nums.pop() nums.pop() b calc = input().split(" ") input().split(" ") calc subTotal = a * b a * b subTotal subTotal = a + b a + b subTotal
calc = input().split(" ")

nums = []
subTotal = 0

for i in range(len(calc)):
    if calc[i].isdigit():
        nums.append(int(calc[i]))
    else:
        b = nums.pop()
        a = nums.pop()

        if calc[i] == "+":
            subTotal = a + b
        elif calc[i] == "-":
            subTotal = a - b
        elif calc[i] == "*":
            subTotal = a * b
        
        nums.append(subTotal)

print(" ".join(map(str,nums)))