import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] arr = br.readLine().toCharArray(); ArrayDeque deqInt = new ArrayDeque<>(); ArrayDeque deqBool = new ArrayDeque<>(); int base = 0; boolean isPlus = true; for (char c : arr) { if (c == '+') { isPlus = true; } else if (c == '-') { isPlus = false; } else if (c == '(') { deqInt.push(base); deqBool.push(isPlus); base = 0; isPlus = true; } else if (c == ')') { int x = deqInt.pop(); isPlus = deqBool.pop(); if (isPlus) { base = x + base; } else { base = x - base; } } else { if (isPlus) { base += c - '0'; } else { base -= c - '0'; } } } System.out.println(base); } }