#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int K = 32;
  int q;
  cin >> q;
  long long sum[K];
  multiset<int> elems[K];
  for (int i = 0; i < K; i++) sum[i] = 0;
  stringstream ss;
  for (int i = 0; i < q; i++) {
    char c;
    int v;
    cin >> c >> v;
    int b = 32 - __builtin_clz(v);
    if (c == '+') {
      elems[b].insert(v);
      sum[b] += v;
    } else {
      elems[b].erase(elems[b].find(v));
      sum[b] -= v;
    }
    long long pre = 0;
    int cnt = 0;
    for (int i = 0; i < K; i++) {
      if (elems[i].size()) {
        int y = *elems[i].begin();
        if (y > pre * 2) cnt--;
        pre += sum[i];
        cnt += elems[i].size();
      }
    }
    ss << cnt << endl;
  }
  cout << ss.str();
  return 0;
}
