#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, arr[100000], i, ans1 = 0, ans2 = 0;
  char ch;
  cin >> a >> b;
  ans1 = b;
  while (a--) {
    cin >> ch >> c;
    if (ch == '+') {
      ans1 += c;
      b += c;
    } else {
      if (c > b) {
        ans2++;
      } else {
        b -= c;
        ans1 -= c;
      }
    }
  }
  cout << ans1 << " " << ans2 << endl;
}
