import re S = input() def check(s): return not re.match(r"^[^+-].*[^+-]$", s) is None print( max( [ eval(s) for s in [re.sub(r"0+(\d+)", r"\1", t) for t in [S[i:] + S[:i] for i in range(len(S))]] if check(s) ] ) )