#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, d = 0;
  long long x, amount;
  char sign;
  int quantity;
  cin >> n >> amount;
  for (int i = 0; i < n; i++) {
    cin >> sign >> quantity;
    if (sign == '+')
      amount += quantity;
    else if (amount < quantity)
      d++;
    else
      amount -= quantity;
  }
  cout << amount << ' ' << d;
}
int main() {
  solve();
  return 0;
}
