#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  long long int n, k, a, cc = 0;
  char c;
  cin >> n >> k;
  while (n--) {
    cin >> c >> a;
    if (c == '+') {
      k += a;
    } else {
      if (k >= a)
        k -= a;
      else
        cc++;
    }
  }
  cout << k << " " << cc << endl;
  return 0;
}
