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