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