#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l, ctr = 0;
  char a;
  cin >> i >> j;
  for (k = 0; k < i; k++) {
    cin >> a;
    cin >> l;
    if (a == '+') {
      j = j + l;
    } else if (j - l >= 0 && a == '-') {
      j = j - l;
    } else if (j - l <= 0 && a == '-') {
      ctr++;
    }
  }
  cout << j << " " << ctr;
}
