#include <bits/stdc++.h>
using namespace std;
const long long N = 40;
long long s[N];
multiset<long long> a[N];
void solve() {
  long long q, n = 0;
  cin >> q;
  while (q--) {
    char c;
    long long x;
    cin >> c >> x;
    long long i = 0;
    long long f = x;
    while (f) {
      f /= 2;
      ++i;
    }
    if (c == '+') {
      ++n;
      a[i].insert(x);
      s[i] += x;
    }
    if (c == '-') {
      --n;
      a[i].erase(a[i].find(x));
      s[i] -= x;
    }
    if (n <= 1) {
      cout << "0\n";
      continue;
    }
    long long good = 0, cur = 0;
    for (long long j = 0; j < N; j++) {
      if (!(int)a[j].size()) continue;
      if (cur && cur * 2 < *a[j].begin()) ++good;
      cur += s[j];
    }
    cout << n - good - 1 << '\n';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
}
