#include <bits/stdc++.h>
using namespace std;
int const oo = 1e9;
int const mod = 1e9 + 7;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long x, a;
  int n, cont = 0;
  char c;
  cin >> n >> x;
  for (int i = 0; i < int(n); i++) {
    cin >> c >> a;
    if (c == '+')
      x += a;
    else {
      if (a > x)
        cont++;
      else
        x -= a;
    }
  }
  cout << x << " " << cont << endl;
  return 0;
}
