#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long x, num;
  while (cin >> n >> x) {
    num = 0;
    for (int i = 1; i <= n; i++) {
      char str[10];
      int k;
      cin >> str >> k;
      if (str[0] == '+') {
        x += k;
      } else {
        if (k <= x)
          x -= k;
        else {
          num++;
        }
      }
    }
    cout << x << " " << num << endl;
  }
  return 0;
}
