from operator import *
li = []
for s in input().split():
    if s.isdigit():
        li.append(int(s))
    else:
        b = li.pop()
        a = li.pop()
        li.append({"+":add, "-":sub, "*":mul}[s](a, b))
print(li[-1])
 from operator import * li = [] li [] for s in input().split():
    if s.isdigit():
        li.append(int(s))
    else:
        b = li.pop()
        a = li.pop()
        li.append({"+":add, "-":sub, "*":mul}[s](a, b)) s input().split() ().split () input split if s.isdigit():
        li.append(int(s))
    else:
        b = li.pop()
        a = li.pop()
        li.append({"+":add, "-":sub, "*":mul}[s](a, b)) s.isdigit() s.isdigit s isdigit li.append(int(s)) li.append li append int(s) int s b = li.pop() b li.pop() li.pop li pop a = li.pop() a li.pop() li.pop li pop li.append({"+":add, "-":sub, "*":mul}[s](a, b)) li.append li append {"+":add, "-":sub, "*":mul}[s](a, b) [s] {"+":add, "-":sub, "*":mul} "+" "+" add "-" "-" sub "*" "*" mul s a b print(li[-1]) print li[-1] li -1 li = [] [] li a = li.pop() li.pop() a b = li.pop() li.pop() b
from operator import *
li = []
for s in input().split():
    if s.isdigit():
        li.append(int(s))
    else:
        b = li.pop()
        a = li.pop()
        li.append({"+":add, "-":sub, "*":mul}[s](a, b))
print(li[-1])

