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