# -*- coding:utf-8 -*- def calc(shiki): global nums stack = [] ans = 0 a = 0 ope = "+" shiki+="*" for i in shiki: if i in nums: stack.append(int(i)) else: keta = 1 a = 0 while len(stack) > 0: a += keta * stack.pop() keta *= 10 if ope == "-": ans -= a else: ans += a ope = i return ans if __name__ == "__main__": s = raw_input() nums = map(str,range(10)) prev = s[len(s)-1] mx = 0 for i in xrange(len(s)): if s[i] in nums and prev in nums: temp = s[i:len(s)] + s[0:i] mx = max(mx,calc(temp)) prev = s[i] print mx