#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long people, ice, num, dist = 0;
  char ch;
  cin >> people >> ice;
  while (people--) {
    cin >> ch >> num;
    if (ch == '+') {
      ice += num;
    } else if (ch == '-') {
      if (ice < num) {
        dist++;
      } else if (ice >= num) {
        ice -= num;
      }
    }
  }
  cout << ice << " " << dist << endl;
  return 0;
}
