#include #include using namespace std; typedef long long ll; string S; int i = 0; ll f(); //--------------------------------------------------------------------------------------------------- ll g() { if ('0' <= S[i] and S[i] <= '9') { ll res = S[i] - '0'; i++; return res; } if (S[i] == '(') { i++; ll res = f(); i++; return res; } } ll f() { ll res = g(); while (1) { if (S[i] == '+') { i++; res += g(); } else if (S[i] == '-') { i++; res -= g(); } else return res; } } //--------------------------------------------------------------------------------------------------- int main() { cin >> S; cout << f() << endl; return 0; }