#include <bits/stdc++.h>
const int mod = 1000000007;
const long long nmax = 1000000000000000007;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, x;
  cin >> n >> x;
  long long sum = x;
  long long b = 0;
  for (long long i = 0; i < n; ++i) {
    char c;
    long long a;
    cin >> c >> a;
    if (c == '+')
      sum += a;
    else {
      if (sum >= a)
        sum -= a;
      else
        b++;
    }
  }
  cout << sum << " " << b;
  return 0;
}
