#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long x;
  cin >> x;
  int dist = 0;
  for (int i = 0; i < n; i++) {
    char rec;
    cin >> rec;
    int d;
    cin >> d;
    if (rec == '+') {
      x += d;
    } else {
      if (d > x) {
        dist++;
      } else {
        x -= d;
      }
    }
  }
  cout << x << " " << dist;
  return 0;
}
