#include <bits/stdc++.h>
int main() {
  int n;
  long long s;
  scanf("%d %lld\n", &n, &s);
  int unsatisfied = 0;
  for (int i = 1; i <= n; ++i) {
    char type;
    int crt;
    scanf("%c %d\n", &type, &crt);
    if (type == '+') {
      s += crt;
    } else {
      if (s >= crt) {
        s -= crt;
      } else {
        ++unsatisfied;
      }
    }
  }
  printf("%I64d %d\n", s, unsatisfied);
  return 0;
}
