poland = input().split()
num = []
for p in poland:
    if p.isdigit():
        num.append(int(p))
    else:
        b = num.pop()
        a = num.pop()
        if p == '*':
            num.append(a * b)
        elif p == '/':
            num.append(a / b)
        elif p == '+':
            num.append(a + b)
        elif p == '-':
            num.append(a - b)
print(num.pop()) poland = input().split() poland input().split() ().split () input split num = [] num [] for p in poland:
    if p.isdigit():
        num.append(int(p))
    else:
        b = num.pop()
        a = num.pop()
        if p == '*':
            num.append(a * b)
        elif p == '/':
            num.append(a / b)
        elif p == '+':
            num.append(a + b)
        elif p == '-':
            num.append(a - b) p poland if p.isdigit():
        num.append(int(p))
    else:
        b = num.pop()
        a = num.pop()
        if p == '*':
            num.append(a * b)
        elif p == '/':
            num.append(a / b)
        elif p == '+':
            num.append(a + b)
        elif p == '-':
            num.append(a - b) p.isdigit() p.isdigit p isdigit num.append(int(p)) num.append num append int(p) int p b = num.pop() b num.pop() num.pop num pop a = num.pop() a num.pop() num.pop num pop if p == '*':
            num.append(a * b)
        elif p == '/':
            num.append(a / b)
        elif p == '+':
            num.append(a + b)
        elif p == '-':
            num.append(a - b) p == '*' p '*' num.append(a * b) num.append num append a * b a b elif p == '/':
            num.append(a / b)
         p == '/' p '/' num.append(a / b) num.append num append a / b a b elif p == '+':
            num.append(a + b)
         p == '+' p '+' num.append(a + b) num.append num append a + b a b elif p == '-':
            num.append(a - b) p == '-' p '-' num.append(a - b) num.append num append a - b a b print(num.pop()) print num.pop() num.pop num pop a = num.pop() num.pop() a poland = input().split() input().split() poland num = [] [] num b = num.pop() num.pop() b
poland = input().split()
num = []
for p in poland:
    if p.isdigit():
        num.append(int(p))
    else:
        b = num.pop()
        a = num.pop()
        if p == '*':
            num.append(a * b)
        elif p == '/':
            num.append(a / b)
        elif p == '+':
            num.append(a + b)
        elif p == '-':
            num.append(a - b)
print(num.pop())