#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0;
  long int a;
  long long int s;
  char ch;
  cin >> n >> s;
  while (n--) {
    cin >> ch >> a;
    if (ch == '-' && s < a)
      c++;
    else if (ch == '-')
      s -= a;
    else
      s += a;
  }
  cout << s << " " << c << endl;
  return 0;
}
