#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long x;
  while (cin >> n >> x) {
    long long sum = x, p;
    int d = 0;
    char c;
    while (n--) {
      cin >> c >> p;
      if (c == '+')
        sum += p;
      else {
        if (sum < p)
          d++;
        else
          sum -= p;
      }
    }
    cout << sum << " " << d << "\n";
  }
  return 0;
}
