#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, x, a, pack, c = 0, ch = 0;
  char s;
  cin >> n >> x;
  pack = x;
  for (int i = 1; i <= n; i++) {
    cin >> s >> a;
    if (s == '+')
      pack += a;
    else if (s == '-') {
      if (pack < a)
        ch++;
      else
        pack -= a;
    }
  }
  cout << pack << " " << ch << endl;
  return 0;
}
