s = input() stc = [] stc2 = [] ope = [] for i in s: if i.isdigit() == True: stc.append(i) else: ope.append("".join(stc)) stc = [] stc2.append(i) else: ope.append("".join(stc)) stc = [] for j in range(len(stc2)): ope.append(stc2.pop(0)) for k in ope: x = 0 if k.isdigit() == True: stc.append(k) elif k == "+": x = int(stc.pop(0)) * int(stc.pop(0)) stc.append(str(x)) elif k == "*": x = int(stc.pop(0)) + int(stc.pop(0)) stc.append(str(x)) else: print(stc.pop())