#include <bits/stdc++.h>
using namespace std;
int main() {
  long long d, cnt = 0, i, j, n, x;
  char ch;
  cin >> n >> x;
  for (i = 0; i < n; i++) {
    cin >> ch >> d;
    if (ch == '+') {
      x += d;
    } else if (ch == '-') {
      if (x < d) {
        cnt++;
      } else {
        x -= d;
      }
    }
  }
  cout << x << " " << cnt << endl;
  return (0);
}
