#include using namespace std; #define fastcin {\ cin.tie(0);\ ios::sync_with_stdio(false);\ } #define rep(i, a, b) for(int i = a; i < b; i++) #define rrep(i, a, b) for(int i = a; i >= b; i--) typedef vector vi; int main() { fastcin; string s; cin >> s; int ans = 0; int k = 1, b = 1; rep(i, 0, s.length()) { char c = s[i]; if(c>=0+'0' && c<=9+'0') { ans += k*b*(c-'0'); } else if(c=='+') b = 1; else if(c=='-') b = -1; else if(c=='(') { k = b; b = 1; } else if(c==')') k = 1; } cout << ans << endl; }