#include <bits/stdc++.h>
using namespace std;
int n, cnt;
long long x;
int main() {
  scanf("%d", &n);
  cin >> x;
  ;
  scanf("\n");
  for (int i = 1; i <= n; ++i) {
    char c;
    scanf("%c", &c);
    int val;
    scanf("%d", &val);
    if (c == '+')
      x += (long long)val;
    else if (x >= val)
      x -= (long long)val;
    else
      ++cnt;
    scanf("\n");
  }
  cout << x << " " << cnt;
  return 0;
}
