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