# -*- coding:utf-8 -*-

stack = list()

def deal_expression(x):
    if x.isdigit():
        stack.append(int(x))
    else:
        a = stack.pop()
        b = stack.pop()
        if x == '+':
            stack.append(b + a)
        elif x == '-':
            stack.append(b - a)
        elif x == '*':
            stack.append(b * a)
        elif x == '/':
            stack.append(b / a)

for x in input().split():
    deal_expression(x)
print(stack[0]) stack = list() stack list() list def deal_expression(x):
    if x.isdigit():
        stack.append(int(x))
    else:
        a = stack.pop()
        b = stack.pop()
        if x == '+':
            stack.append(b + a)
        elif x == '-':
            stack.append(b - a)
        elif x == '*':
            stack.append(b * a)
        elif x == '/':
            stack.append(b / a) deal_expression if x.isdigit():
        stack.append(int(x))
    else:
        a = stack.pop()
        b = stack.pop()
        if x == '+':
            stack.append(b + a)
        elif x == '-':
            stack.append(b - a)
        elif x == '*':
            stack.append(b * a)
        elif x == '/':
            stack.append(b / a) x.isdigit() x.isdigit x isdigit stack.append(int(x)) stack.append stack append int(x) int x a = stack.pop() a stack.pop() stack.pop stack pop b = stack.pop() b stack.pop() stack.pop stack pop if x == '+':
            stack.append(b + a)
        elif x == '-':
            stack.append(b - a)
        elif x == '*':
            stack.append(b * a)
        elif x == '/':
            stack.append(b / a) x == '+' x '+' stack.append(b + a) stack.append stack append b + a b a elif x == '-':
            stack.append(b - a)
         x == '-' x '-' stack.append(b - a) stack.append stack append b - a b a elif x == '*':
            stack.append(b * a)
         x == '*' x '*' stack.append(b * a) stack.append stack append b * a b a elif x == '/':
            stack.append(b / a) x == '/' x '/' stack.append(b / a) stack.append stack append b / a b a x x for x in input().split():
    deal_expression(x) x input().split() ().split () input split deal_expression(x) deal_expression x print(stack[0]) print stack[0] stack 0 def deal_expression(x):
    if x.isdigit():
        stack.append(int(x))
    else:
        a = stack.pop()
        b = stack.pop()
        if x == '+':
            stack.append(b + a)
        elif x == '-':
            stack.append(b - a)
        elif x == '*':
            stack.append(b * a)
        elif x == '/':
            stack.append(b / a) def deal_expression(x):
    if x.isdigit():
        stack.append(int(x))
    else:
        a = stack.pop()
        b = stack.pop()
        if x == '+':
            stack.append(b + a)
        elif x == '-':
            stack.append(b - a)
        elif x == '*':
            stack.append(b * a)
        elif x == '/':
            stack.append(b / a) deal_expression stack = list() list() stack
# -*- coding:utf-8 -*-

stack = list()

def deal_expression(x):
    if x.isdigit():
        stack.append(int(x))
    else:
        a = stack.pop()
        b = stack.pop()
        if x == '+':
            stack.append(b + a)
        elif x == '-':
            stack.append(b - a)
        elif x == '*':
            stack.append(b * a)
        elif x == '/':
            stack.append(b / a)

for x in input().split():
    deal_expression(x)
print(stack[0])