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