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