list = input().split(' ')

OPERATOR = {
  '+': lambda a, b: a + b,
  '*': lambda a, b: a * b,
  '-': lambda a, b: a - b,
  '/': lambda a, b: a / b,
}

stack = []
for item in list:
  if item in OPERATOR:
    b = stack.pop()
    a = stack.pop()
    stack.append(OPERATOR[item](a, b))
  else:
    stack.append(int(item))

print(stack.pop())
 list = input().split(' ') list input().split(' ') ().split () input split ' ' OPERATOR = {
  '+': lambda a, b: a + b,
  '*': lambda a, b: a * b,
  '-': lambda a, b: a - b,
  '/': lambda a, b: a / b,
} OPERATOR {
  '+': lambda a, b: a + b,
  '*': lambda a, b: a * b,
  '-': lambda a, b: a - b,
  '/': lambda a, b: a / b,
} '+' '+' lambda a, b: a + b a + b a b a b '*' '*' lambda a, b: a * b a * b a b a b '-' '-' lambda a, b: a - b a - b a b a b '/' '/' lambda a, b: a / b a / b a b a b stack = [] stack [] for item in list:
  if item in OPERATOR:
    b = stack.pop()
    a = stack.pop()
    stack.append(OPERATOR[item](a, b))
  else:
    stack.append(int(item)) item list if item in OPERATOR:
    b = stack.pop()
    a = stack.pop()
    stack.append(OPERATOR[item](a, b))
  else:
    stack.append(int(item)) item in OPERATOR item OPERATOR b = stack.pop() b stack.pop() stack.pop stack pop a = stack.pop() a stack.pop() stack.pop stack pop stack.append(OPERATOR[item](a, b)) stack.append stack append OPERATOR[item](a, b) [item] OPERATOR item a b stack.append(int(item)) stack.append stack append int(item) int item print(stack.pop()) print stack.pop() stack.pop stack pop list = input().split(' ') input().split(' ') list a = stack.pop() stack.pop() a stack = [] [] stack b = stack.pop() stack.pop() b OPERATOR = {
  '+': lambda a, b: a + b,
  '*': lambda a, b: a * b,
  '-': lambda a, b: a - b,
  '/': lambda a, b: a / b,
} {
  '+': lambda a, b: a + b,
  '*': lambda a, b: a * b,
  '-': lambda a, b: a - b,
  '/': lambda a, b: a / b,
} OPERATOR
list = input().split(' ')

OPERATOR = {
  '+': lambda a, b: a + b,
  '*': lambda a, b: a * b,
  '-': lambda a, b: a - b,
  '/': lambda a, b: a / b,
}

stack = []
for item in list:
  if item in OPERATOR:
    b = stack.pop()
    a = stack.pop()
    stack.append(OPERATOR[item](a, b))
  else:
    stack.append(int(item))

print(stack.pop())

