S = input() i = 0 ans = 0 sgn = 1 flag = True while i < len(S): if S[i] == "+" and flag: i += 1 continue elif S[i] == "+": sgn = -1 elif S[i] == "-" and flag: sgn = -1 elif S[i] == "-": sgn = 1 elif S[i] == "(" and i > 0 and S[i-1] == "-": flag = False elif S[i] == "(": i += 1 continue elif S[i] == ")": flag = True else: ans += sgn*int(S[i]) i += 1 print(ans)