#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, r, d = 0;
  cin >> n >> x;
  r = x;
  for (long long i = 0; i < n; i++) {
    char ch;
    long long a;
    cin >> ch >> a;
    if (ch == '+') {
      r += a;
    } else {
      if (r < a)
        ++d;
      else
        r -= a;
    }
  }
  cout << r << " " << d << "\n";
}
