S=input() ans=0 for i in range(len(S)): s=S[i:]+S[:i] if s[0]=='-' or s[0]=='+' or s[-1]=='-' or s[-1]=='+': continue ans=max(ans,eval(s)) print(ans)