#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long bal;
  cin >> n >> bal;
  char ch;
  int d, disd = 0;
  while (n--) {
    cin >> ch >> d;
    if (ch == '-') {
      if (d > bal)
        disd++;
      else
        bal -= d;
    } else if (ch == '+')
      bal += d;
  }
  cout << bal << " " << disd;
}
