#include <bits/stdc++.h>
using namespace std;
long long x;
int n, dis;
int main() {
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    char c;
    int a;
    cin >> c >> a;
    if (c == '+') {
      x += a;
    } else {
      if (a <= x) {
        x -= a;
        continue;
      }
      dis++;
    }
  }
  cout << x << " " << dis;
}
