#include <bits/stdc++.h>
int cmpfunc(const void *a, const void *b) { return (*(int *)a - *(int *)b); }
void swap(long long int *a, long long int *b) {
  long long int t;
  t = *a;
  *a = *b;
  *b = t;
}
void array_scan(long long int *p, long long int n) {
  long long int i;
  for (i = 0; i < n; i++) scanf("%lld", p + i);
}
int main() {
  int n;
  long long int x, d, answer1 = 0, answer2 = 0;
  char c;
  scanf("%d %lld", &n, &x);
  while (n--) {
    scanf("%c%c %lld", &c, &c, &d);
    if (c == '+')
      x += d;
    else {
      if (x >= d) {
        x -= d;
      } else
        answer2++;
    }
  }
  answer1 = x;
  printf("%lld %lld", answer1, answer2);
}
