import java.io.InputStream; import java.io.PrintWriter; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.PriorityQueue; import java.util.Scanner; import java.util.Set; import java.util.Stack; import java.util.TreeMap; import java.util.TreeSet; import static java.util.Comparator.*; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out); Solver solver = new Solver(System.in, out); solver.solve(); out.close(); } } class Solver { Scanner sc; PrintWriter out; public Solver(InputStream in, PrintWriter out) { sc = new Scanner(in); this.out = out; } // ================================================================== public void solve() { char[] C = sc.next().toCharArray(); int ans = 0; char pre = '+'; boolean rev = false; boolean f = true; for (int i = 0; i < C.length; i++) { if(C[i] == '+') { if(!rev) { f = true; // out.println(" + 次を足す"); } else { f = false; // out.println(" + だけど、次を引く"); } } else if(C[i] == '-') { if(!rev) { f = false; // out.println(" - 次を引く"); } else { f = true; // out.println(" - だけど、次を足す"); } } else if(C[i] == '(') { if(pre == '-') { rev = true; // out.println(" 括弧の前が - なので リバース ON"); } } else if(C[i] == ')') { rev = false; // out.println(" 括弧が終わったから リバース OFF"); } else { if(f) { ans += (int)(C[i] - '0'); // out.println(" C[" + i + "] = " + C[i] + " を足す"); } else { ans -= (int)(C[i] - '0'); // out.println(" C[" + i + "] = " + C[i] + " を引く"); } // out.println("ans = " + ans); } pre = C[i]; } out.println(ans); } }