#include using namespace std; string s; int x, y, ans; int main() { cin >> s; ans = 0, x = y = 1; for (int i = 0; i < s.size(); ++i) { if ('0' <= s[i] && s[i] <= '9') { ans += x * y * (s[i] - '0'); } else if (s[i] == '-') { if (x == -1) y = -1; else x = -1, y = 1; } else if (s[i] == ')') { x = y = 1; } } printf("%d\n", ans); return 0; }