#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T x) {
  return x * x;
}
const long long shl = 1;
const long long MAXN = 1123456;
vector<long long> tt[1000];
set<long long> s;
map<string, long long> mp;
string s2, s1, s3;
char cc;
long long c, sc, n, m, i, j, a[MAXN], b[MAXN], a1, b1, c1, ans, x, k;
template <typename T>
void vout(T s) {
  cout << s << "\n";
  exit(0);
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> x;
  while (n--) {
    cin >> cc >> a1;
    if (cc == '+')
      x += a1;
    else {
      if (x < a1)
        ans++;
      else
        x -= a1;
    }
  }
  cout << x << " " << ans << "\n";
  return 0;
}
