#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x;
  cin >> n >> x;
  int count = 0;
  for (int i = 0; i < n; i++) {
    char c;
    int t;
    cin >> c;
    cin >> t;
    if (c == '+') {
      x += t;
    } else {
      if (x < t) {
        count++;
      } else {
        x -= t;
      }
    }
  }
  cout << x << " " << count << endl;
}
