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