from collections import deque S = input() formula = deque(S) ans = [eval(S)] for _ in range(len(S)-1): formula.rotate(1) s = ''.join(formula).lstrip('0') if s[0] != '+' and s[0] != '-' and s[-1] != '+' and s[-1] != '-': ans.append(eval(s)) print(max(ans))