#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using tpi = pair<pii, int>;
using tpl = pair<pll, ll>;
class CP {
 public:
  CP() {}
  void solN(int id) {
    int n, nw = 0;
    ll x;
    cin >> n >> x;
    while (n--) {
      char pm;
      int val;
      cin >> pm >> val;
      if (pm == '+')
        x += val;
      else {
        if (x >= val)
          x -= val;
        else
          nw++;
      }
    }
    cout << x << " " << nw << '\n';
  }
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1, id = 1;
  CP think;
  while (t--) think.solN(id++);
  return 0;
}
