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