S = input() res = 0 for i in range(len(S)): T = S[i:] + S[:i] if T.startswith("+") or T.startswith("-"): continue if T.endswith("+") or T.endswith("-"): continue res = max(res, eval(T)) print(res)