#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long x, d;
  int cntDist = 0;
  string inp;
  cin >> n >> x;
  getline(cin, inp);
  for (int i = 0; i < n; i++) {
    getline(cin, inp);
    stringstream ss(inp.substr(2));
    ss >> d;
    if (inp[0] == '+') {
      x += d;
    } else {
      if (x < d)
        cntDist++;
      else
        x -= d;
    }
  }
  cout << x << " " << cntDist;
  return 0;
}
