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)) print(ope) for k in ope: x = 0 if k.isdigit() == True: stc.append(k) print(stc) elif k == "+": x = int(stc.pop(0)) * int(stc.pop(0)) stc.append(str(x)) print(stc) elif k == "*": x = int(stc.pop(0)) + int(stc.pop(0)) stc.append(str(x)) print(stc) else: print(stc.pop())