#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
int a[maxn];
int main() {
  int n, d;
  long long x;
  while (cin >> n >> x) {
    char c;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      cin >> c >> d;
      if (c == '+')
        x += d;
      else {
        if (x < d) {
          cnt++;
        } else
          x -= d;
      }
    }
    cout << x << " " << cnt << endl;
  }
  return 0;
}
