#include <bits/stdc++.h>
using namespace std;
bool compare_first(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first < b.first;
}
bool compare_second(pair<int, pair<int, int> > a,
                    pair<int, pair<int, int> > b) {
  return a.second.first < b.second.first;
}
long long min(long long a, long long b) {
  if (a > b) return b;
  return a;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long toINT(string s) {
  long long a = 0;
  for (long long index = 0; index < s.size(); index++)
    a = a * 10 + (s[index] - '0');
  return a;
}
int main() {
  ios::sync_with_stdio(false);
  long long n, x;
  cin >> n >> x;
  long long have = x;
  long long ans = 0;
  for (long long index = 0; index < n; index++) {
    char op;
    long long packs;
    cin >> op >> packs;
    if (op == '+')
      have += packs;
    else {
      if (have < packs)
        ans++;
      else
        have -= packs;
    }
  }
  cout << have << " " << ans << endl;
  return 0;
}
