a=input().split()
operator={
  '+':(lambda x,y:x+y),
  '-':(lambda x,y:x-y),
  '*':(lambda x,y:x*y),
  '/':(lambda x,y:float(x)/y)
}
stack=[]
for i,j in enumerate(a):
  if j not in operator.keys():
    stack.append(int(j))
    continue
  y=stack.pop()
  x=stack.pop()
  stack.append(operator[j](x,y))
print(stack[0])
    
   a=input().split() a input().split() ().split () input split operator={
  '+':(lambda x,y:x+y),
  '-':(lambda x,y:x-y),
  '*':(lambda x,y:x*y),
  '/':(lambda x,y:float(x)/y)
} operator {
  '+':(lambda x,y:x+y),
  '-':(lambda x,y:x-y),
  '*':(lambda x,y:x*y),
  '/':(lambda x,y:float(x)/y)
} '+' '+' lambda x,y:x+y x+y x y x y '-' '-' lambda x,y:x-y x-y x y x y '*' '*' lambda x,y:x*y x*y x y x y '/' '/' lambda x,y:float(x)/y float(x)/y float(x) float x y x y stack=[] stack [] for i,j in enumerate(a):
  if j not in operator.keys():
    stack.append(int(j))
    continue
  y=stack.pop()
  x=stack.pop()
  stack.append(operator[j](x,y)) i j enumerate(a) enumerate a if j not in operator.keys():
    stack.append(int(j))
    continue
   j not in operator.keys() j operator.keys() operator.keys operator keys stack.append(int(j)) stack.append stack append int(j) int j continue y=stack.pop() y stack.pop() stack.pop stack pop x=stack.pop() x stack.pop() stack.pop stack pop stack.append(operator[j](x,y)) stack.append stack append operator[j](x,y) [j] operator j x y print(stack[0]) print stack[0] stack 0 a=input().split() input().split() a y=stack.pop() stack.pop() y x=stack.pop() stack.pop() x stack=[] [] stack operator={
  '+':(lambda x,y:x+y),
  '-':(lambda x,y:x-y),
  '*':(lambda x,y:x*y),
  '/':(lambda x,y:float(x)/y)
} {
  '+':(lambda x,y:x+y),
  '-':(lambda x,y:x-y),
  '*':(lambda x,y:x*y),
  '/':(lambda x,y:float(x)/y)
} operator
a=input().split()
operator={
  '+':(lambda x,y:x+y),
  '-':(lambda x,y:x-y),
  '*':(lambda x,y:x*y),
  '/':(lambda x,y:float(x)/y)
}
stack=[]
for i,j in enumerate(a):
  if j not in operator.keys():
    stack.append(int(j))
    continue
  y=stack.pop()
  x=stack.pop()
  stack.append(operator[j](x,y))
print(stack[0])
    
  
