f = input() def cal(x): sq = list(x) sm = int(sq[0]) for i in range((len(sq)-1)//2): if sq[2*i+1] == '+': sm += int(sq[2*(i+1)]) else: sm -= int(sq[2*(i+1)]) return sm ro = [] lo = [] for i in range(len(f)): if f[i] == '(': ro.append(i) elif f[i] == ')': lo.append(i) pls = [] for i in range(len(ro)): p = f[ro[i]+1:lo[i]] pls.append(p) for i in pls: f = f.replace("("+i+")",str(cal(i))) f = f.replace('--','+') f = f.replace('+-','-') a = cal(f) print(a)