use std::io::{Read, stdin}; fn main() { let mut buf = String::new(); stdin().read_to_string(&mut buf).unwrap(); let mut tok = buf.split_whitespace(); let mut get = || tok.next().unwrap(); let expr = get().as_bytes(); let mut ans = 0; let mut sign = 1; let mut bra = 1; for &ch in expr { match ch { b'+' => sign = 1, b'-' => sign = -1, b'(' => { bra = sign; sign = 1; }, b')' => { bra = 1; sign = 1; }, ch => { let v = ch as i64 - b'0' as i64; ans += sign * bra * v; }, }; } println!("{}", ans); }