#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#pragma GCC target("avx,avx2,fma")
const long long int LL_MAX = 1e18 + 5;
const int MX = INT_MAX;
const long long int mod = 1000000007;
const int maxx = 2e5;
const int d4i[4] = {-1, 0, 1, 0};
const int d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};
void solve() {
  long long int q, n;
  cin >> q >> n;
  ;
  long long int ans = 0;
  for (long long int i = (0); i < (q); i++) {
    long long int k;
    char t;
    cin >> t >> k;
    if (t == '+')
      n += k;
    else if (t == '-') {
      if (n < k)
        ans++;
      else
        n -= k;
    }
  }
  cout << n << " " << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
