import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = read().rstrip().decode() INF = 10 ** 18 answer = -INF for _ in range(20): S = S[-1] + S[:-1] if S[0] in '+-': continue if S[-1] in '+-': continue words = S.replace('+',' + ').replace('-',' - ').split() words[::2] = [str(int(x)) for x in words[::2]] x = eval(''.join(words)) if answer < x: answer = x print(answer)