s = input() ans = 0 pas = -1 pm = "+" for i in range(len(s)): if s[i] == "(": a = int(s[i+1]) b = int(s[i+3]) if s[i+2] == "+": if pm == "+": ans += a+b else: ans -= a+b else: if pm == "+": ans += a-b else: ans -= a-b pas += 1 if pas == -1: if s[i] == "+": pm = "+" elif s[i] == "-": pm = "-" else: if pm == "+": ans += int(s[i]) else: ans -= int(s[i]) elif pas == 4: pas = -1 else: pas += 1 print(ans)