#include <bits/stdc++.h>
using namespace std;
const long long int N = 10000015;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(nullptr);
  cin.tie(nullptr);
  cout.precision(20);
  long long int n, iceCream, upsetchildren = 0;
  cin >> n >> iceCream;
  for (int i = 0; i < (n); i++) {
    char c;
    int temp;
    cin >> c;
    cin >> temp;
    if (c == '+') {
      iceCream += temp;
    } else if (c == '-') {
      if (iceCream >= temp) {
        iceCream -= temp;
      } else {
        upsetchildren++;
      }
    }
  }
  cout << iceCream << " " << upsetchildren;
  return 0;
}
