s_0 = list(input()) def calc(s): N = len(s) ans = int(s[0]) num = False plus = True for i in range(1,N): if num: if plus: ans += int(s[i]) else: ans -= int(s[i]) num = False else: if s[i] == '+': plus = True else: plus = False num = True return ans while '(' in s_0: left = s_0.index('(') right = s_0.index(')') s_dush = s_0[left+1:right] ans = calc(s_dush) s_0 = s_0[:left] + [str(ans)] + s_0[right+1:] print(calc(s_0))