#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, t, n, k;
char s;
int main() {
  cin >> n >> k;
  b += k;
  for (int i = 0; i < n; i++) {
    cin >> s >> a;
    if (s == '+') {
      b += a;
    }
    if (s == '-') {
      if (b < a) {
        c++;
      } else {
        b -= a;
      }
    }
  }
  cout << b << " " << c << endl;
}
