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