import math from math import sqrt import sys from collections import deque, defaultdict from heapq import heappop, heappush from copy import deepcopy INF = 10 ** 18 MOD = 10 ** 9 + 7 MAX = 10 ** 5 + 7 mp=defaultdict(int) def rec(t): if len(t)==3: a=t[0]-'0' b=t[2]-'0' if t[1]=='+': return a+b else: return a-b res=0 r=0 for i,c in enumerate(t): if c=='+': r=0 elif c=='-': r=1 elif c=='(': if r==0: res+=rec(t[i+1:mp[i]]) else : res-=rec(t[i+1:mp[i]]) else: if r==0: res+=int(c) else: res-=int(c) return res def main(): global s, mp s=input() st=() for i,c in enumerate(s): if c=='(': st.append(i) elif c==')': mp[st.pop()]=i print(rec(s)) if __name__ == '__main__': main()