notation = input().split()
stack = []
for s in notation:
    try:
        stack.append(int(s))
    except:
        n = 0
        if s == '+':
            n = stack[-2] + stack[-1]
        elif s == '-':
            n = stack[-2] - stack[-1]
        elif s == '*':
            n = stack[-2] * stack[-1]
        elif s == '/':
            n = stack[-2] / stack[-1]

        stack = stack[:-2] + [n]

assert(len(stack) == 1)
print(stack[0])
 notation = input().split() notation input().split() ().split () input split stack = [] stack [] for s in notation:
    try:
        stack.append(int(s))
    except:
        n = 0
        if s == '+':
            n = stack[-2] + stack[-1]
        elif s == '-':
            n = stack[-2] - stack[-1]
        elif s == '*':
            n = stack[-2] * stack[-1]
        elif s == '/':
            n = stack[-2] / stack[-1]

        stack = stack[:-2] + [n] s notation try:
        stack.append(int(s))
    except:
        n = 0
        if s == '+':
            n = stack[-2] + stack[-1]
        elif s == '-':
            n = stack[-2] - stack[-1]
        elif s == '*':
            n = stack[-2] * stack[-1]
        elif s == '/':
            n = stack[-2] / stack[-1]

        stack = stack[:-2] + [n] except:
        n = 0
        if s == '+':
            n = stack[-2] + stack[-1]
        elif s == '-':
            n = stack[-2] - stack[-1]
        elif s == '*':
            n = stack[-2] * stack[-1]
        elif s == '/':
            n = stack[-2] / stack[-1]

        stack = stack[:-2] + [n] n = 0 n 0 if s == '+':
            n = stack[-2] + stack[-1]
        elif s == '-':
            n = stack[-2] - stack[-1]
        elif s == '*':
            n = stack[-2] * stack[-1]
        elif s == '/':
            n = stack[-2] / stack[-1]

         s == '+' s '+' n = stack[-2] + stack[-1] n stack[-2] + stack[-1] stack[-2] stack -2 stack[-1] stack -1 elif s == '-':
            n = stack[-2] - stack[-1]
         s == '-' s '-' n = stack[-2] - stack[-1] n stack[-2] - stack[-1] stack[-2] stack -2 stack[-1] stack -1 elif s == '*':
            n = stack[-2] * stack[-1]
         s == '*' s '*' n = stack[-2] * stack[-1] n stack[-2] * stack[-1] stack[-2] stack -2 stack[-1] stack -1 elif s == '/':
            n = stack[-2] / stack[-1]

         s == '/' s '/' n = stack[-2] / stack[-1] n stack[-2] / stack[-1] stack[-2] stack -2 stack[-1] stack -1 stack = stack[:-2] + [n] stack stack[:-2] + [n] stack[:-2] stack :-2 -2 [n] n stack.append(int(s)) stack.append stack append int(s) int s assert(len(stack) == 1) len(stack) == 1 len(stack) len stack 1 print(stack[0]) print stack[0] stack 0 n = stack[-2] / stack[-1] stack[-2] / stack[-1] n n = 0 0 n stack = [] [] stack notation = input().split() input().split() notation n = stack[-2] - stack[-1] stack[-2] - stack[-1] n n = stack[-2] * stack[-1] stack[-2] * stack[-1] n n = stack[-2] + stack[-1] stack[-2] + stack[-1] n stack = stack[:-2] + [n] stack[:-2] + [n] stack
notation = input().split()
stack = []
for s in notation:
    try:
        stack.append(int(s))
    except:
        n = 0
        if s == '+':
            n = stack[-2] + stack[-1]
        elif s == '-':
            n = stack[-2] - stack[-1]
        elif s == '*':
            n = stack[-2] * stack[-1]
        elif s == '/':
            n = stack[-2] / stack[-1]

        stack = stack[:-2] + [n]

assert(len(stack) == 1)
print(stack[0])

