S=input() an=-1 for i in range(len(S)): if S[0].isdigit() and S[-1].isdigit(): an=max(an,eval(S)) S=S[1::]+S[0] print(an)