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