#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, val;
  cin >> n >> x;
  long long int stock = x;
  int distress = 0;
  char sign;
  while (n--) {
    cin >> sign >> val;
    if (sign == '+') {
      stock += val;
    } else {
      if (stock >= val)
        stock = stock - val;
      else {
        distress++;
      }
    }
  }
  cout << stock << " " << distress << endl;
  return 0;
}
