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