S=input() MAX=-1<<60 for i in range(len(S)): if S[0] in "+-" or S[-1] in "+-": True else: MAX=max(MAX,eval(S)) S=S[1:]+S[0] print(MAX)