#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x;
  cin >> n >> x;
  char c[n];
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> c[i] >> a[i];
  }
  long long dis = 0;
  long long ice = x;
  for (long long i = 0; i < n; i++) {
    if (c[i] == '+') {
      ice += a[i];
    } else {
      if (ice >= a[i]) {
        ice -= a[i];
      } else {
        dis++;
      }
    }
  }
  cout << ice << " " << dis << endl;
}
