#include <bits/stdc++.h>
using namespace std;
map<int, int> b;
struct node {
  char a;
  long long b;
} stu[2000];
int main() {
  long long i, j, k, m, n, num = 0, p;
  scanf("%lld %lld", &n, &m);
  for (i = 0; i < n; i++) scanf("%s %lld", &stu[i].a, &stu[i].b);
  for (i = 0; i < n; i++) {
    if (stu[i].a == '+') m += stu[i].b;
    if (stu[i].a == '-') {
      if (m >= stu[i].b)
        m -= stu[i].b;
      else
        num++;
    }
  }
  printf("%lld %lld\n", m, num);
  return 0;
}
