S = input() ans = -1 << 30 for _ in range(10): if S[0].isdigit() and S[-1].isdigit(): tmp = 0 ope = "+" T = "" for s in S: if s.isdigit(): T += s else: if ope == "+": tmp += int(T) else: tmp -= int(T) ope = s T = "" if ope == "+": tmp += int(T) else: tmp -= int(T) ope = s ans = max(ans, tmp) S = S[1:] + S[0] print(ans)