S = input() def check(s): if s.startswith("+") or s.startswith("-"): return False if s.endswith("+") or s.endswith("-"): return False for i in range(len(s) - 1): if s[i] in "-+" and s[i + 1] in "-+": return False return True res = 0 for i in range(len(S)): T = S[i:] + S[:i] if not check(T): continue res = max(res, eval(T)) print(res)