S=input() an=-10**18 for i in range(len(S)): T=S if T[0].isdigit() and T[-1].isdigit(): for i in range(len(S)): T=T.replace('+0','+') T=T.replace('-0','-') while T[0]=='0': T=T[1::] if not T[0].isdigit(): T='0'+T if not T[-1].isdigit(): T=T+'0' an=max(an,eval(T)) S=S[1::]+S[0] print(an)