import java.io.*; import java.util.*; public class Main_yukicoder708 { private static Scanner sc; private static Printer pr; private static void solve() { char[] s = sc.next().toCharArray(); int n = s.length; Deque q = new ArrayDeque<>(); q.addLast("0"); q.addLast("+"); for (int i = 0; i < n; i++) { char c = s[i]; if (c >= '0' && c <= '9') { int num = c - '0'; if (q.peekLast().equals("+")) { q.removeLast(); int tmp = Integer.parseInt(q.removeLast()); tmp += num; q.addLast(Integer.toString(tmp)); } else if (q.peekLast().equals("-")) { q.removeLast(); int tmp = Integer.parseInt(q.removeLast()); tmp -= num; q.addLast(Integer.toString(tmp)); } else if (q.peekLast().equals("(")) { q.addLast(Integer.toString(num)); } } else if (c == '+') { q.addLast("+"); } else if (c == '-') { q.addLast("-"); } else if (c == '(') { q.addLast("("); } else if (c == ')') { int num = Integer.parseInt(q.removeLast()); q.removeLast(); // '(' if (q.peekLast().equals("+")) { q.removeLast(); int tmp = Integer.parseInt(q.removeLast()); tmp += num; q.addLast(Integer.toString(tmp)); } else if (q.peekLast().equals("-")) { q.removeLast(); int tmp = Integer.parseInt(q.removeLast()); tmp -= num; q.addLast(Integer.toString(tmp)); } } } pr.println(Integer.parseInt(q.peekLast())); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())); pr = new Printer(System.out); solve(); // pr.close(); pr.flush(); // sc.close(); } static String INPUT = null; private static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }