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