#include <bits/stdc++.h> 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(1)),res2=stoi(match.str(3)); if (match.str(2) == "+" || match.str(2) == "--" || match.str(2) == "++") res2 *= -1; cout << res1 + res2 << "\n"; return 0; }