S = raw_input() N = len(S) ans = 0 for i in range(N): if S[i-1].isdigit() and S[i].isdigit(): tmp = pre = 0 op = "+" ns = S[i:N] + S[0:i] for i in range(N): if ns[i].isdigit(): continue if op == "+": tmp += int(ns[pre:i]) else: tmp -= int(ns[pre:i]) op = ns[i] pre = i+1 else: if op == "+": tmp += int(ns[pre:N]) else: tmp -= int(ns[pre:N]) ans = max(ans,tmp) print ans