#include <bits/stdc++.h>
using namespace std;
const int mxN = 2e5;
int n, a[mxN], k;
void solve() {
  long long i, n, b, x, child = 0;
  char a;
  cin >> n >> x;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    if (a == '+') {
      x += b;
    } else {
      if (x < b)
        child += 1;
      else {
        x -= b;
      }
    }
  }
  cout << x << " " << child << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
