def f(L, R): val = 0 pm = 1 i = L while i != R: if S[i] == "+": pm = 1 elif S[i] == "-": pm = -1 elif S[i] == "(": val += pm * f(i + 1, D[i]) i = D[i] else: val += pm * int(S[i]) i += 1 return val S = list(input()) N = len(S) stack = [] D = dict() for i in range(N): if S[i] == ")": while stack[-1][0] != "(": stack.pop() _, ind = stack.pop() D[ind] = i else: stack.append((S[i], i)) print(f(0, N))