#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x;
  cin >> n >> x;
  long long gerda = 0;
  vector<pair<char, int>> queue;
  for (int i = 0; i < n; i++) {
    char op;
    cin >> op;
    int x;
    cin >> x;
    queue.push_back(make_pair(op, x));
  }
  for (auto q : queue) {
    char op = q.first;
    long long y = q.second;
    if (op == '+') x += y;
    if (op == '-') {
      if (x - y >= 0) {
        x -= y;
      } else {
        gerda++;
      }
    }
  }
  cout << x << " " << gerda;
}
