#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, a, ans = 0;
  char c;
  cin >> n >> x;
  for (long long i = 1; i <= n; i++) {
    cin >> c >> a;
    if (c == '+')
      x += a;
    else {
      if (x < a) ans++;
      if (x >= a) x -= a;
    }
  }
  cout << x << " " << ans << "\n";
}
