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