S = input() ans_l = [] for i in range(len(S)): newS = S[i:] + S[:i] if newS[0] == "+" or newS[0] == "-": continue if newS[-1] == "+" or newS[-1] == "-": continue if "+-" in newS or "-+" in newS: continue ans_l.append(eval(newS)) print(max(ans_l))