from typing import cast S = input() T = S+S ans = -10**20 for i in range(len(S)): U = T[i:len(S)+i] if not(U[0]=='+' or U[0]=='-' or U[-1]=='+' or U[-1]=='-'): try: exec("a = " + U) ans = max(a,ans) except Exception as e: pass print(ans)