S = list(input()) NUM = [str(i) for i in range(10)] ans = -10**10 for i in range(len(S)): x = "".join(S[i:]+S[:i]) if x[0] not in NUM or x[-1] not in NUM: continue ans = max(ans,eval(x)) print(ans)