#include <bits/stdc++.h>
using namespace std;
multiset<long long> buckets[30];
long long bsum[30];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int q, tot = 0;
  cin >> q;
  while (q--) {
    char c;
    long long x;
    cin >> c >> x;
    int p = 31 - __builtin_clz(x), ans = 0;
    if (c == '+')
      buckets[p].insert(x), bsum[p] += x, tot++;
    else
      buckets[p].erase(buckets[p].find(x)), bsum[p] -= x, tot--;
    long long sm = 0;
    for (int i = 0; i < 30; i++)
      if (buckets[i].size()) {
        if (*buckets[i].begin() > 2 * sm) ans++;
        sm += bsum[i];
      }
    cout << tot - ans << '\n';
  }
  return 0;
}
