print((lambda s:[s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1]for c in input().split()][-1])([0])) s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1]for c in input().split() for c in input().split() c input().split() ().split () input split for c in input().split() s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1] s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c) s.append s append str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c c in "+-*" c "+-*" str(eval(s.pop(-2)+c+s.pop())) str eval(s.pop(-2)+c+s.pop()) eval s.pop(-2)+c+s.pop() s.pop(-2)+c s.pop(-2) s.pop s pop -2 c s.pop() s.pop s pop c s[-1] s -1 print((lambda s:[s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1]for c in input().split()][-1])([0])) print (lambda s:[s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1]for c in input().split()][-1])([0]) lambda s:[s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1]for c in input().split()][-1] [s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1]for c in input().split()][-1] [s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1]for c in input().split()] -1 s [0] 0
print((lambda s:[s.append(str(eval(s.pop(-2)+c+s.pop())) if c in "+-*" else c)or s[-1]for c in input().split()][-1])([0]))