#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
inline int in() {
  int x;
  cin >> x;
  return x;
}
template <class T>
void max_self(T &a, const T &b) {
  if (a < b) a = b;
}
template <class T>
void min_self(T &a, const T &b) {
  if (a > b) a = b;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long N, ice, dC = 0;
  cin >> N >> ice;
  for (int rep = 0; rep < N; ++rep) {
    char c;
    long long ds;
    cin >> c >> ds;
    if (c == '+')
      ice += ds;
    else if (ds <= ice)
      ice -= ds;
    else
      dC++;
  }
  cout << ice << " " << dC << "\n";
  return 0;
}
