#include using namespace std; int main() { string s; cin >> s; int absx = 0, absy = 0, signx = 1, signy = 1, op = 0, flag = false; for (auto& c : s) { if (c >= '0' && c <= '9') { ((op ? absy : absx) *= 10) += c - '0'; flag = true; } else { int sign = (c == '+' ? 1 : -1); if (!flag) signx = sign; else if (!op) op = sign; else { signy = sign; } } } cout << signx * absx - op * signy * absy << endl; }