#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  long long int tenho = m;
  int r = 0;
  for (int i = 0; i < n; i++) {
    char p;
    long long int x;
    cin >> p >> x;
    if (p == '+')
      tenho += x;
    else {
      if (tenho - x >= 0)
        tenho -= x;
      else
        r++;
    }
  }
  cout << tenho << " " << r << "\n";
  return 0;
}
