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