#include <bits/stdc++.h>
using namespace std;
long long n, x, d;
int sad;
string s;
int main() {
  cin >> n >> x;
  while (n--) {
    string s;
    long long d;
    cin >> s >> d;
    if (s[0] == '+') {
      x += d;
    } else {
      if (d <= x) {
        x -= d;
      } else
        sad++;
    }
  }
  cout << x << " " << sad << "\n";
}
