#include <bits/stdc++.h>
using namespace std;
int main() {
  long long sumice, n, num, sumkids = 0;
  char s;
  cin >> n >> sumice;
  for (int i = 0; i < n; i++) {
    cin >> s >> num;
    if (s == '+') {
      sumice = sumice + num;
    }
    if (s == '-' && sumice < num) {
      sumkids = sumkids + 1;
    }
    if (s == '-' && sumice >= num) {
      sumice = sumice - num;
    }
  }
  cout << sumice << " " << sumkids << endl;
}
