#include using namespace std; using i64 = long long; #define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++) struct Exe{ string s; Exe(const string & S) : s(S){ if(s[0] != '-') s = "+" + s; } int value(){ int ans = 0; int cnt = 0; int si = 0; for(int i = 0;i < s.size();i++){ char c = s[i]; if(cnt == 0){ if(c == '+') si = 1; else si = -1; cnt++; } else{ if(c == '('){ i++; int open = 1; string N = ""; while(true){ if(s[i] == ')'){ open--; if(open == 0) break; } if(s[i] == '('){ open++; } N += s[i]; i++; } ans += si * (int)(Exe(N).value() - '0'); } else{ ans += si * (int)(c - '0'); } cnt--; } } return ans; } }; int main(){ string s; cin >> s; cout << Exe(s).value() << endl; }