#include <bits/stdc++.h>
using namespace std;
int stones;
int main() {
  long long t, total;
  cin >> t >> total;
  long long ans = 0, distress = 0;
  char ch;
  long long a;
  while (t--) {
    cin >> ch >> a;
    if (ch == '+')
      total += a;
    else {
      if (total >= a)
        total -= a;
      else
        distress++;
    }
  }
  cout << total << " " << distress << "\n";
}
