#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5;
const int nax = 1e6 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, x;
  cin >> n >> x;
  int count = 0;
  for (int i = (0); i <= ((n)-1); ++i) {
    char ch;
    cin >> ch;
    int d;
    cin >> d;
    if (ch == '+') {
      x += d;
    } else {
      if (x >= d) {
        x -= d;
      } else {
        count++;
      }
    }
  }
  cout << x << " " << count << "\n";
  return 0;
}
