#include <bits/stdc++.h>
using std::cin;
using std::cout;
long long int x;
int n, d, answer = 0;
char type;
int main() {
  cin >> n >> x;
  while (n--) {
    cin >> type >> d;
    if (type == '+')
      x += d;
    else if (d > x)
      answer++;
    else
      x -= d;
  }
  cout << x << ' ' << answer;
  return 0;
}
