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, eval(T)) print(ans)