#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXQ = 500000;
int nq;
char qkind[MAXQ];
int qval[MAXQ], qans[MAXQ];
int a[MAXQ], na;
int sum;
int cnt[MAXQ];
set<int> have;
set<int> opt;
long long bit[MAXQ + 1];
long long bget(int idx) {
  ++idx;
  long long ret = 0;
  while (idx > 0) {
    ret += bit[idx];
    idx -= idx & -idx;
  }
  return ret;
}
void bmod(int idx, int by) {
  ++idx;
  while (idx <= na) {
    bit[idx] += by;
    idx += idx & -idx;
  }
}
void solve() {
  na = 0;
  for (int i = (0); i < (nq); ++i) a[na++] = qval[i];
  sort(a, a + na);
  na = unique(a, a + na) - a;
  have.clear();
  opt.clear();
  sum = 0;
  for (int i = (0); i < (na); ++i) cnt[i] = 0;
  for (int i = (0); i <= (na); ++i) bit[i] = 0;
  for (int i = (0); i < (nq); ++i) {
    int idx = lower_bound(a, a + na, qval[i]) - a;
    if (qkind[i] == '+') {
      ++sum, ++cnt[idx];
      bmod(idx, +a[idx]);
      if (cnt[idx] == 1) {
        have.insert(idx);
        auto it = have.find(idx);
        assert(it != have.end());
        if (it != have.begin()) {
          int pidx = *prev(it);
          if (2 * a[pidx] < a[idx]) opt.insert(idx);
        }
        if (next(it) != have.end()) {
          int nidx = *next(it);
          if (it == have.begin()) {
            if (2 * a[idx] < a[nidx]) opt.insert(nidx);
          } else {
            int pidx = *prev(it);
            if (2 * a[pidx] < a[nidx] && 2 * a[idx] >= a[nidx]) opt.erase(nidx);
          }
        }
      }
    } else {
      --sum, --cnt[idx];
      bmod(idx, -a[idx]);
      if (cnt[idx] == 0) {
        auto it = have.find(idx);
        assert(it != have.end());
        if (it != have.begin()) {
          int pidx = *prev(it);
          if (2 * a[pidx] < a[idx]) opt.erase(idx);
        }
        if (next(it) != have.end()) {
          int nidx = *next(it);
          if (it == have.begin()) {
            if (2 * a[idx] < a[nidx]) opt.erase(nidx);
          } else {
            int pidx = *prev(it);
            if (2 * a[pidx] < a[nidx] && 2 * a[idx] >= a[nidx])
              opt.insert(nidx);
          }
        }
        have.erase(it);
      }
    }
    qans[i] = max(0, sum - 1);
    for (auto it = opt.begin(); it != opt.end(); ++it) {
      int idx = *it;
      if (2 * bget(idx - 1) < a[idx]) --qans[i];
    }
  }
}
void run() {
  scanf("%d", &nq);
  for (int i = (0); i < (nq); ++i) scanf(" %c%d", &qkind[i], &qval[i]);
  solve();
  for (int i = (0); i < (nq); ++i) printf("%d\n", qans[i]);
}
int main() {
  run();
  return 0;
}
