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