#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long int x;
  cin >> n >> x;
  int p = 0;
  for (int i = 0; i < n; i++) {
    char a;
    long long int b;
    cin >> a >> b;
    if (a == '+')
      x += b;
    else {
      if ((x - b) >= 0)
        x = x - b;
      else
        p++;
    }
  }
  cout << x << " " << p;
  return 0;
}
