from string import * s = input() res = -99999999 for _ in range(len(s)): if s[0] in digits and s[-1] in digits: res = max(res, eval(s)) s = s[1:] + s[0] print(res)