form = input().split()
s = []
for c in form:
    if c in "+-*":
        s.append(str(eval( "{2} {0} {1}".format(c,s.pop(),s.pop()) )))
    else:
        s.append(c)
print(s[0]) form = input().split() form input().split() ().split () input split s = [] s [] for c in form:
    if c in "+-*":
        s.append(str(eval( "{2} {0} {1}".format(c,s.pop(),s.pop()) )))
    else:
        s.append(c) c form if c in "+-*":
        s.append(str(eval( "{2} {0} {1}".format(c,s.pop(),s.pop()) )))
    else:
        s.append(c) c in "+-*" c "+-*" s.append(str(eval( "{2} {0} {1}".format(c,s.pop(),s.pop()) ))) s.append s append str(eval( "{2} {0} {1}".format(c,s.pop(),s.pop()) )) str eval( "{2} {0} {1}".format(c,s.pop(),s.pop()) ) eval "{2} {0} {1}".format(c,s.pop(),s.pop()) "{2} {0} {1}".format "{2} {0} {1}" format c s.pop() s.pop s pop s.pop() s.pop s pop s.append(c) s.append s append c print(s[0]) print s[0] s 0 form = input().split() input().split() form s = [] [] s
form = input().split()
s = []
for c in form:
    if c in "+-*":
        s.append(str(eval( "{2} {0} {1}".format(c,s.pop(),s.pop()) )))
    else:
        s.append(c)
print(s[0])