#include <bits/stdc++.h>   using namespace std;   const double pi = 2 * acos(0.0);   const int INF = 0x3f3f3f3f;   const double inf = 1.0 / 0.0;   void solve();   void Adi() {     ios::sync_with_stdio(false);     cin.tie(0);   }   int main() {     Adi();     solve();     cerr <<  time taken :   << (float)clock() / CLOCKS_PER_SEC <<   secs           <<   n ;     return 0;   }   void solve() {     long long n, x, tt = 0, dis = 0, rem = 0;     char s;     cin >> n >> x;     vector<long long> v;     for (int i = 0; i < n; i++) {       long long q;       cin >> s >> q;       if (s ==  - ) q = -q;       v.push_back(q);     }     for (int i = 0; i < n; i++) {       if (v[i] >= 0)         x += v[i];       else if (v[i] < 0) {         if (x >= abs(v[i]))           x += v[i];         else           dis++;       }     }     cout << x <<     << dis;   }   