import sys
sys.stdin = open("input.txt", "rt")
a = input()
stack = []
calNum=0
for x in a:
if x.isdecimal():
stack.append(int(x))
else:
tmp = stack.pop()
calNum = stack.pop()
if x == '+':
calNum = calNum + tmp
elif x == '-':
calNum = calNum - tmp
elif x == '*':
calNum = calNum * tmp
else:
calNum = calNum / tmp
stack.append(calNum)
print(calNum)
import sys
sys.stdin = open("input.txt", "rt")
a = input()
stack = []
for x in a:
if x.isdecimal():
stack.append(int(x))
else:
n1 = stack.pop()
n2 = stack.pop()
if x == '+':
stack.append(n2+n1)
elif x == '-':
stack.append(n2-n1)
elif x == '*':
stack.append(n1*n2)
else:
stack.append(n2/n1)
print(stack[0])
한 2줄 더 줄이셨네;; 이정도는 유진아 너도 생각할 수 있지 않니?