in_l = [a for a in input().split()]
stack = []

while len(in_l) > 0:
    i_e = in_l.pop(0)

    if not i_e in "+-*/":
        stack.append(int(i_e))

    else:
        tmp1 = stack.pop(len(stack)-1)
        tmp2 = stack.pop(len(stack)-1)
        if i_e == '+':
            stack.append(tmp2+tmp1)
        elif i_e == '-':
            stack.append(tmp2-tmp1)
        elif i_e == '*':
            stack.append(tmp2*tmp1)
        elif i_e == '/':
            stack.append(tmp2/tmp1)

print(stack.pop(0)) a for a in input().split() for a in input().split() a input().split() ().split () input split for a in input().split() a in_l = [a for a in input().split()] in_l [a for a in input().split()] stack = [] stack [] while len(in_l) > 0:
    i_e = in_l.pop(0)

    if not i_e in "+-*/":
        stack.append(int(i_e))

    else:
        tmp1 = stack.pop(len(stack)-1)
        tmp2 = stack.pop(len(stack)-1)
        if i_e == '+':
            stack.append(tmp2+tmp1)
        elif i_e == '-':
            stack.append(tmp2-tmp1)
        elif i_e == '*':
            stack.append(tmp2*tmp1)
        elif i_e == '/':
            stack.append(tmp2/tmp1) len(in_l) > 0 len(in_l) len in_l 0 i_e = in_l.pop(0) i_e in_l.pop(0) in_l.pop in_l pop 0 if not i_e in "+-*/":
        stack.append(int(i_e))

    else:
        tmp1 = stack.pop(len(stack)-1)
        tmp2 = stack.pop(len(stack)-1)
        if i_e == '+':
            stack.append(tmp2+tmp1)
        elif i_e == '-':
            stack.append(tmp2-tmp1)
        elif i_e == '*':
            stack.append(tmp2*tmp1)
        elif i_e == '/':
            stack.append(tmp2/tmp1) not i_e in "+-*/" i_e in "+-*/" i_e "+-*/" stack.append(int(i_e)) stack.append stack append int(i_e) int i_e tmp1 = stack.pop(len(stack)-1) tmp1 stack.pop(len(stack)-1) stack.pop stack pop len(stack)-1 len(stack) len stack 1 tmp2 = stack.pop(len(stack)-1) tmp2 stack.pop(len(stack)-1) stack.pop stack pop len(stack)-1 len(stack) len stack 1 if i_e == '+':
            stack.append(tmp2+tmp1)
        elif i_e == '-':
            stack.append(tmp2-tmp1)
        elif i_e == '*':
            stack.append(tmp2*tmp1)
        elif i_e == '/':
            stack.append(tmp2/tmp1) i_e == '+' i_e '+' stack.append(tmp2+tmp1) stack.append stack append tmp2+tmp1 tmp2 tmp1 elif i_e == '-':
            stack.append(tmp2-tmp1)
         i_e == '-' i_e '-' stack.append(tmp2-tmp1) stack.append stack append tmp2-tmp1 tmp2 tmp1 elif i_e == '*':
            stack.append(tmp2*tmp1)
         i_e == '*' i_e '*' stack.append(tmp2*tmp1) stack.append stack append tmp2*tmp1 tmp2 tmp1 elif i_e == '/':
            stack.append(tmp2/tmp1) i_e == '/' i_e '/' stack.append(tmp2/tmp1) stack.append stack append tmp2/tmp1 tmp2 tmp1 print(stack.pop(0)) print stack.pop(0) stack.pop stack pop 0 stack = [] [] stack in_l = [a for a in input().split()] [a for a in input().split()] in_l i_e = in_l.pop(0) in_l.pop(0) i_e tmp2 = stack.pop(len(stack)-1) stack.pop(len(stack)-1) tmp2 tmp1 = stack.pop(len(stack)-1) stack.pop(len(stack)-1) tmp1
in_l = [a for a in input().split()]
stack = []

while len(in_l) > 0:
    i_e = in_l.pop(0)

    if not i_e in "+-*/":
        stack.append(int(i_e))

    else:
        tmp1 = stack.pop(len(stack)-1)
        tmp2 = stack.pop(len(stack)-1)
        if i_e == '+':
            stack.append(tmp2+tmp1)
        elif i_e == '-':
            stack.append(tmp2-tmp1)
        elif i_e == '*':
            stack.append(tmp2*tmp1)
        elif i_e == '/':
            stack.append(tmp2/tmp1)

print(stack.pop(0))