#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, count = 0;
  int64_t pack;
  char code;
  int ice;
  cin >> n;
  cin >> pack;
  for (i = 0; i < n; i++) {
    cin >> code;
    cin >> ice;
    if (code == '+') {
      pack = pack + ice;
    } else if (code == '-') {
      if (ice > pack) {
        count++;
      } else {
        pack = pack - ice;
      }
    }
  }
  cout << pack << " " << count;
  return 0;
}
