data = list(map(str,input().split()))
stack = []
op1 = 0
op2 = 0
k = 0
for i in data:
# print(i,type(i))
  if(i == "+" or i == "-" or i == "*" or i == "/"):
    op1 = stack.pop()
    op2 = stack.pop()
    if(i == "+"): stack.append(op2+op1)
    elif(i == "-"): stack.append(op2-op1)
    elif(i == "*"): stack.append(op2*op1)
    elif(i == "/"): stack.append(int(op2/op1))
  else:
    stack.append(int(i))


print(stack.pop())
 data = list(map(str,input().split())) data list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split stack = [] stack [] op1 = 0 op1 0 op2 = 0 op2 0 k = 0 k 0 for i in data:
# print(i,type(i))
  if(i == "+" or i == "-" or i == "*" or i == "/"):
    op1 = stack.pop()
    op2 = stack.pop()
    if(i == "+"): stack.append(op2+op1)
    elif(i == "-"): stack.append(op2-op1)
    elif(i == "*"): stack.append(op2*op1)
    elif(i == "/"): stack.append(int(op2/op1))
  else:
    stack.append(int(i)) i data if(i == "+" or i == "-" or i == "*" or i == "/"):
    op1 = stack.pop()
    op2 = stack.pop()
    if(i == "+"): stack.append(op2+op1)
    elif(i == "-"): stack.append(op2-op1)
    elif(i == "*"): stack.append(op2*op1)
    elif(i == "/"): stack.append(int(op2/op1))
  else:
    stack.append(int(i)) i == "+" or i == "-" or i == "*" or i == "/" i == "+" or i == "-" or i == "*" i == "+" or i == "-" i == "+" i "+" i == "-" i "-" i == "*" i "*" i == "/" i "/" op1 = stack.pop() op1 stack.pop() stack.pop stack pop op2 = stack.pop() op2 stack.pop() stack.pop stack pop if(i == "+"): stack.append(op2+op1)
    elif(i == "-"): stack.append(op2-op1)
    elif(i == "*"): stack.append(op2*op1)
    elif(i == "/"): stack.append(int(op2/op1))
   i == "+" i "+" elif(i == "-"): stack.append(op2-op1)
     i == "-" i "-" elif(i == "*"): stack.append(op2*op1)
     i == "*" i "*" elif(i == "/"): stack.append(int(op2/op1))
   i == "/" i "/" stack.append(int(i)) stack.append stack append int(i) int i print(stack.pop()) print stack.pop() stack.pop stack pop op1 = stack.pop() stack.pop() op1 op2 = 0 0 op2 op2 = stack.pop() stack.pop() op2 op1 = 0 0 op1 data = list(map(str,input().split())) list(map(str,input().split())) data k = 0 0 k stack = [] [] stack
data = list(map(str,input().split()))
stack = []
op1 = 0
op2 = 0
k = 0
for i in data:
# print(i,type(i))
  if(i == "+" or i == "-" or i == "*" or i == "/"):
    op1 = stack.pop()
    op2 = stack.pop()
    if(i == "+"): stack.append(op2+op1)
    elif(i == "-"): stack.append(op2-op1)
    elif(i == "*"): stack.append(op2*op1)
    elif(i == "/"): stack.append(int(op2/op1))
  else:
    stack.append(int(i))


print(stack.pop())

