S = input() maxnum = -9999999999999999999999999 length = len(S) ckecknum = lambda x: not (x == "+" or x == "-") for i in range(length): line = S[i:length] + S[0:i] tline = line while tline[0] == "0": tline = tline[1:len(tline)] j = 1 while j < len(tline): if (tline[j - 1] == "+" or tline[j - 1] == "-") and tline[j] == "0": if j == len(tline) - 1: break else: if tline[j+1].isdigit(): tline = tline[0:j] + tline[j+1:len(tline)] else: j += 1 line = tline first = line[0] end = line[len(line) - 1] if not ckecknum(first) or not ckecknum(end): continue try: maxnum = max(maxnum, eval(line)) except: pass print(maxnum)