import re def rotate(str1: str, n: int): return str1[n:] + str1[:n] def is_stem(stem: str): return not re.match(r'^[^+-].*[^+-]$', stem) is None def solve(str1: str): return max(([eval(stem) for stem in ( [re.sub(r'0+(\d+)', r'\1', rotation) for rotation in ([rotate(str1, i) for i in range(0, len(str1))]) if is_stem(rotation)])])) s = input() print(solve(s))