#include <bits/stdc++.h>
using namespace std;
const long long N = 40;
multiset<long long> g[N];
long long s[N];
long long cnt(long long x) {
  long long tot = 0, now = 1;
  while (now <= x) now <<= 1, tot++;
  return tot;
}
signed main() {
  long long q, x;
  cin >> q;
  char opt;
  while (q--) {
    cin >> opt >> x;
    long long p = cnt(x);
    if (opt == '+')
      g[p].insert(x), s[p] += x;
    else
      g[p].erase(g[p].find(x)), s[p] -= x;
    long long ans = 0;
    long long now = 0;
    for (register long long i = (0); i <= (30); ++i) {
      ans += g[i].size();
      if (2ll * now < *g[i].begin()) ans--;
      now += s[i];
    }
    cout << ans << '\n';
  }
  return 0;
}
