#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  long long x;
  int counter = 0;
  cin >> n >> x;
  string arr[n];
  int arr2[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i] >> arr2[i];
    if (arr[i] == "+") {
      x += arr2[i];
    } else {
      x -= arr2[i];
      if (x < 0) {
        counter++;
        x += arr2[i];
      }
    }
  }
  cout << x << " " << counter;
}
