#include <bits/stdc++.h>
using namespace std;
const long long int hell = (long long int)(1e18 + 100LL);
int main() {
  long long int t, i, j, k, m, n, x, y;
  t = 1;
  while (t--) {
    long long int flag = 0;
    cin >> n >> m;
    long long int c = 0;
    for (i = 0; i < n; i++) {
      char cc;
      cin >> cc >> x;
      if (cc == '-') {
        if (m >= x) {
          m -= x;
        } else {
          c++;
        }
      } else {
        m += x;
      }
    }
    cout << m << " " << c;
  }
  return 0;
}
