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