#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  long long m, x;
  char s[6];
  cin >> n >> m;
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    if (s[0] == '+') {
      cin >> x;
      m += x;
    } else {
      cin >> x;
      if (m >= x)
        m -= x;
      else
        ans++;
    }
  }
  cout << m << " " << ans << endl;
  return 0;
}
