#include <bits/stdc++.h>
using namespace std;
const long long OO = (long long)1e17;
const int MX = (int)1e6 + 1;
const int mod = (int)1e9 + 7;
const double EPS = 1e-6;
const double PI = 3.1415926;
int main(void) {
  ios_base::sync_with_stdio(0);
  long long n, x;
  while (cin >> n >> x) {
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      char sg;
      int val;
      cin >> sg >> val;
      if (sg == '+')
        x += val;
      else {
        if (x < val) {
          cnt++;
        } else {
          x -= val;
        }
      }
    }
    cout << x << " " << cnt << "\n";
  }
  return 0;
}
