import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); String ans = calculate(s); System.out.println(ans); } static private String calculate(String s) { if( !s.contains("+") && !s.contains("-") || s.indexOf("-") == 0 ) { return s; } if( s.contains("(") ) { int start = s.indexOf("("); int end = s.indexOf(")"); String left = s.substring(0, start); String center = calculate(s.substring(start+1, end)); String right = s.substring(end+1, s.length()); if(center.charAt(0) == '-') { if(left.charAt(left.length()-1) == '+') { left = left.substring(0,left.length()-1); } else if(left.charAt(left.length()-1) == '-') { left = left.substring(0,left.length()-1) + "+"; center = center.substring(1,center.length()); } } String sNew = left + center + right; return calculate(sNew); } else { for(int i = 0; i < s.length(); i++) { if(s.charAt(i) == '+' || s.charAt(i) == '-') { int j = i+1; for( ; j < s.length(); j++) { if(s.charAt(j) == '+' || s.charAt(j) == '-') { break; } } String a = s.substring(0,i); String b = s.substring(i+1,j); String sign = s.substring(i,i+1); return calculate (plusminus(a,b,sign) + s.substring(j,s.length())); } } } return ""; } static private String plusminus(String a, String b, String sign) { int aint = Integer.parseInt(a); int bint = Integer.parseInt(b); int rint; if("+".equals(sign)) { rint = aint + bint; } else { rint = aint - bint; } return String.valueOf(rint); } }