S = input() ans = -1 << 30 for _ in range(10): if S[0].isdigit() and S[-1].isdigit(): ans = max(ans, eval(S)) S = S[1:] + S[0] print(ans)