#include #define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++) using namespace std; typedef long long ll; string S; ll p = 0; ll dfs() { ll ret = S[p++] - '0'; while(p < S.length() && S[p] != ')') { char op = S[p++]; ll x; if(S[p] == '(') { p++; x = dfs(); p++; } else { x = S[p] - '0'; p++; } if(op == '+') ret += x; if(op == '-') ret -= x; } return ret; } int main(void) { cin >> S; cout << dfs() << endl; }