input_str = input().split(' ')

stack = []

left_num, right_num = 0, 0
for tmp_str in input_str:
    if tmp_str == '+':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num + right_num)

    elif tmp_str == '-':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num - right_num)

    elif tmp_str == '*':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num * right_num)

    elif tmp_str == '/':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num / right_num)

    else:
        stack.append(int(tmp_str))

print(stack.pop()) input_str = input().split(' ') input_str input().split(' ') ().split () input split ' ' stack = [] stack [] left_num, right_num = 0, 0 left_num 0 right_num 0 for tmp_str in input_str:
    if tmp_str == '+':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num + right_num)

    elif tmp_str == '-':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num - right_num)

    elif tmp_str == '*':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num * right_num)

    elif tmp_str == '/':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num / right_num)

    else:
        stack.append(int(tmp_str)) tmp_str input_str if tmp_str == '+':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num + right_num)

    elif tmp_str == '-':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num - right_num)

    elif tmp_str == '*':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num * right_num)

    elif tmp_str == '/':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num / right_num)

    else:
        stack.append(int(tmp_str)) tmp_str == '+' tmp_str '+' right_num = stack.pop() right_num stack.pop() stack.pop stack pop left_num = stack.pop() left_num stack.pop() stack.pop stack pop stack.append(left_num + right_num) stack.append stack append left_num + right_num left_num right_num elif tmp_str == '-':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num - right_num)

     tmp_str == '-' tmp_str '-' right_num = stack.pop() right_num stack.pop() stack.pop stack pop left_num = stack.pop() left_num stack.pop() stack.pop stack pop stack.append(left_num - right_num) stack.append stack append left_num - right_num left_num right_num elif tmp_str == '*':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num * right_num)

     tmp_str == '*' tmp_str '*' right_num = stack.pop() right_num stack.pop() stack.pop stack pop left_num = stack.pop() left_num stack.pop() stack.pop stack pop stack.append(left_num * right_num) stack.append stack append left_num * right_num left_num right_num elif tmp_str == '/':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num / right_num)

     tmp_str == '/' tmp_str '/' right_num = stack.pop() right_num stack.pop() stack.pop stack pop left_num = stack.pop() left_num stack.pop() stack.pop stack pop stack.append(left_num / right_num) stack.append stack append left_num / right_num left_num right_num stack.append(int(tmp_str)) stack.append stack append int(tmp_str) int tmp_str print(stack.pop()) print stack.pop() stack.pop stack pop stack = [] [] stack left_num, right_num = 0, 0 0 left_num right_num = stack.pop() stack.pop() right_num right_num = stack.pop() stack.pop() right_num input_str = input().split(' ') input().split(' ') input_str left_num = stack.pop() stack.pop() left_num right_num = stack.pop() stack.pop() right_num right_num = stack.pop() stack.pop() right_num left_num = stack.pop() stack.pop() left_num left_num = stack.pop() stack.pop() left_num right_num = 0, 0 0 right_num left_num = stack.pop() stack.pop() left_num
input_str = input().split(' ')

stack = []

left_num, right_num = 0, 0
for tmp_str in input_str:
    if tmp_str == '+':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num + right_num)

    elif tmp_str == '-':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num - right_num)

    elif tmp_str == '*':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num * right_num)

    elif tmp_str == '/':
        right_num = stack.pop()
        left_num = stack.pop()
        stack.append(left_num / right_num)

    else:
        stack.append(int(tmp_str))

print(stack.pop())
