#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define int long long #define endl '\n' #define INF 1000000000000000000 #define EPS 1e-10 #define PI 3.141592653589793238 #define all(a) a.begin(),a.end() #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define double long double using namespace std; typedef long long ll; typedef pair P; typedef pair PP; typedef complex com; template bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; } template bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; } ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); } ll lcm(ll n, ll m) { return n / gcd(n, m)*m; } int stolll(string s) { if (s == "") return 0; else return stoll(s); } signed main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); //modcalc(); string a, b; cin >> a >> b; string s = a + b; if (s.size() >= 19) { bool flag = true; for (char c : s) { if (c == '-' || c == '+') { flag = false; } } if (flag) { cout << s << endl; return 0; } } int ans = 0; int mode = 1; string now = ""; for (char c : s) { if (c == '-') { ans += stolll(now)*mode; now = ""; mode = -1; } else if (c == '+') { ans += stolll(now)*mode; now = ""; mode = -1; } else { now += c; } } ans += stolll(now)*mode; cout << ans << endl; }