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