#include #include #include using namespace std; int main(){ string s, op, now; int a, b, ans, cnt=0; bool f = false, p = false, m = false; cin >> s; for(int i = 0; i < s.size(); i++){ if(s.at(i) == '+' || s.at(i) == '-'){ if(cnt != 0){ ans = stoi(now); if(m) ans *= -1; a = ans; p = false; m = false; f = true; cnt = 0; }else{ if(!f){ if(s.at(i) == '+') p = true; if(s.at(i) == '-') m = true; }else{ op = s.at(i); f = false; } } }else{ now.append(now.size(), s.at(i)); cnt++; } } ans = stoi(now); if(m) ans *= -1; b = ans; printf("%d\n", a+b); }