a = input().split()
b = []
for i in range(len(a)):
    if a[i] == "+":
        b[-2] = b[-2] + b[-1]
        b.pop()
    elif a[i] == "-":
        b[-2] = b[-2] - b[-1]
        b.pop()
    elif a[i] == "*":
        b[-2] = b[-2] * b[-1]
        b.pop()
    else:
        b.append(int(a[i]))
print(b[-1]) a = input().split() a input().split() ().split () input split b = [] b [] for i in range(len(a)):
    if a[i] == "+":
        b[-2] = b[-2] + b[-1]
        b.pop()
    elif a[i] == "-":
        b[-2] = b[-2] - b[-1]
        b.pop()
    elif a[i] == "*":
        b[-2] = b[-2] * b[-1]
        b.pop()
    else:
        b.append(int(a[i])) i range(len(a)) range len(a) len a if a[i] == "+":
        b[-2] = b[-2] + b[-1]
        b.pop()
    elif a[i] == "-":
        b[-2] = b[-2] - b[-1]
        b.pop()
    elif a[i] == "*":
        b[-2] = b[-2] * b[-1]
        b.pop()
    else:
        b.append(int(a[i])) a[i] == "+" a[i] a i "+" b[-2] = b[-2] + b[-1] b[-2] b -2 b[-2] + b[-1] b[-2] b -2 b[-1] b -1 b.pop() b.pop b pop elif a[i] == "-":
        b[-2] = b[-2] - b[-1]
        b.pop()
     a[i] == "-" a[i] a i "-" b[-2] = b[-2] - b[-1] b[-2] b -2 b[-2] - b[-1] b[-2] b -2 b[-1] b -1 b.pop() b.pop b pop elif a[i] == "*":
        b[-2] = b[-2] * b[-1]
        b.pop()
     a[i] == "*" a[i] a i "*" b[-2] = b[-2] * b[-1] b[-2] b -2 b[-2] * b[-1] b[-2] b -2 b[-1] b -1 b.pop() b.pop b pop b.append(int(a[i])) b.append b append int(a[i]) int a[i] a i print(b[-1]) print b[-1] b -1 a = input().split() input().split() a b = [] [] b
a = input().split()
b = []
for i in range(len(a)):
    if a[i] == "+":
        b[-2] = b[-2] + b[-1]
        b.pop()
    elif a[i] == "-":
        b[-2] = b[-2] - b[-1]
        b.pop()
    elif a[i] == "*":
        b[-2] = b[-2] * b[-1]
        b.pop()
    else:
        b.append(int(a[i]))
print(b[-1])
