# -*- coding: utf-8 -*- S = raw_input() N = len(S) mx = 0 for _ in xrange(N): S = S[1:] + S[0] if S[0] == "+" or S[0] == "-" or S[-1] == "+" or S[-1] == "-": continue ans = eval(S) mx = max(mx, ans) print mx