S = raw_input() ans = -999999 for i in xrange(len(S)): s = S[i:] + S[:i] if s[0] in "+-" or s[-1] in "+-": continue while "+0" in s or "-0" in s: s = s.replace("+0", "+").replace("-0", "-") ans = max(ans, eval(s)) print ans