def myeval(S): C = "" op = "" res = 0 for i in range(len(S)): if S[i] in "0123456789": C += S[i] else: T = int(C) C = "" if op == "+": res += T elif op == "-": res -= T else: res = T op = S[i] T = int(C) if op == "+": res += T elif op == "-": res -= T return res S = input().rstrip() ans = 0 for i in range(len(S)): T = S[i:] + S[0:i] #print(T) if T[0] in "0123456789" and T[-1] in "0123456789": ans = max(ans, myeval(T)) print(ans)