s = input() N = len(s) s += s ans = -10**15 for i in range(N): if s[i].isdigit() and s[i+N-1].isdigit(): ans = max(ans, eval(s[i:i+N])) print(ans)