#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  unsigned long long n, x, k, sad = 0;
  char sign;
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> sign >> k;
    if (sign == '-') {
      if (x < k) {
        sad += 1;
      } else {
        x = x - k;
      }
    } else {
      x = x + k;
    };
  }
  cout << x << " " << sad;
  return 0;
}
