#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 51, MOD = 1e9 + 7;
const long double EPS = 0.000000001, PI = atan2(0, -1);
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, x, kol = 0;
  cin >> n >> x;
  for (long long i = 0; i < n; i++) {
    char c;
    long long k;
    cin >> c >> k;
    if (c == '+')
      x += k;
    else {
      if (k <= x)
        x -= k;
      else
        kol++;
    }
  }
  cout << x << ' ' << kol;
}
