#include using namespace std; using ll = long long; using ul = unsigned long; using ull = unsigned long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; string pattern = "([+-]*)(\\d+)([+-]+)(\\d+)"; regex re(pattern); smatch match; regex_match(s, match, re); int res1=stoi(match.str(2)),res2=stoi(match.str(4)); if (match.str(1) == "-") res1 *= -1; if (match.str(3) == "+" || match.str(3) == "--" || match.str(3) == "++") res2 *= -1; cout << res1 + res2 << "\n"; return 0; }