#include <bits/stdc++.h>
using namespace std;
const int maxn = 500005;
long long F[maxn];
long long sumPref(int k) {
  long long ret = 0;
  k++;
  for (int i = k; i > 0; i -= -i & i) ret += F[i];
  return ret;
}
long long sum(int from, int to) {
  if (from > to) return 0LL;
  return sumPref(to) - sumPref(from - 1);
}
void add(int pos, long long value) {
  pos++;
  for (int i = pos; i < maxn; i += -i & i) F[i] += value;
}
int main() {
  ios_base::sync_with_stdio(0);
  int q;
  cin >> q;
  set<pair<int, int>> S;
  vector<tuple<int, long long>> pivots;
  vector<char> qc(q);
  vector<int> qx(q);
  vector<bool> active(q);
  vector<int> is_pivot(q);
  vector<pair<int, int>> R;
  for (int i = 0; i < q; ++i) {
    cin >> qc[i] >> qx[i];
    active[i] = false;
    R.push_back({qx[i], i});
  }
  sort(R.begin(), R.end());
  int SZ = 0;
  int F = 1;
  for (int i = 0; i < q; ++i) {
    if (pivots.size() > 40) {
      F++;
      vector<tuple<int, long long>> np;
      for (int j = 0; j < (int)pivots.size(); ++j)
        if (active[get<0>(pivots[j])]) {
          auto it = S.lower_bound({qx[get<0>(pivots[j])], get<0>(pivots[j])});
          int prev = 0;
          if (it != S.begin()) {
            --it;
            prev = it->first;
            ++it;
          }
          if (prev * 2 < qx[get<0>(pivots[j])]) {
            np.push_back(pivots[j]);
            is_pivot[get<0>(pivots[j])] = F;
          }
        }
      pivots = np;
    }
    int first = qx[i];
    char c = qc[i];
    active[i] = true;
    int pos = lower_bound(R.begin(), R.end(), make_pair(first, i)) - R.begin();
    int sign = (c == '+' ? 1 : -1);
    SZ += sign;
    int myid = -1;
    if (sign == 1) {
      myid = i;
      S.insert({first, i});
      active[i] = true;
      bool good = true;
      auto it = S.lower_bound({first, i});
      if (it != S.begin()) {
        --it;
        if ((it->first) * 2 >= first) good = false;
        ++it;
      }
      add(pos, first);
      if (good && is_pivot[i] != F) {
        pivots.push_back(make_tuple(i, sum(0, pos - 1)));
        is_pivot[i] = F;
      }
    }
    if (sign == -1) {
      auto it = S.lower_bound({first, -1});
      assert(it != S.end());
      active[it->second] = false;
      myid = it->second;
      pos = lower_bound(R.begin(), R.end(), make_pair(first, myid)) - R.begin();
      int prev = 0;
      if (it != S.begin()) {
        --it;
        prev = it->first;
        ++it;
      }
      ++it;
      if (it != S.end() && it->first > 2 * prev && is_pivot[it->second] != F) {
        int mpos =
            lower_bound(R.begin(), R.end(), make_pair(it->first, it->second)) -
            R.begin();
        pivots.push_back(make_tuple(it->second, sum(0, mpos - 1)));
        is_pivot[it->second] = F;
      }
      --it;
      S.erase(it);
      add(pos, -first);
    }
    int ans = SZ - 1;
    for (int j = 0; j < (int)pivots.size(); ++j) {
      if (!active[get<0>(pivots[j])]) continue;
      pivots[j] = make_tuple(
          get<0>(pivots[j]),
          get<1>(pivots[j]) +
              (make_pair(first, myid) <
                       make_pair(qx[get<0>(pivots[j])], get<0>(pivots[j]))
                   ? (long long)(sign * first)
                   : 0));
      int xx =
          lower_bound(R.begin(), R.end(),
                      make_pair(qx[get<0>(pivots[j])], get<0>(pivots[j]))) -
          R.begin();
      assert(get<1>(pivots[j]) == sum(0, xx - 1));
      if (get<1>(pivots[j]) * 2LL < (long long)qx[get<0>(pivots[j])] &&
          get<1>(pivots[j]) != 0)
        ans--;
    }
    if (q <= 5000) {
      int rans = 0;
      long long cursum = 0;
      for (auto v : S) {
        if (cursum > 0 && cursum * 2 < v.first) {
          rans++;
          assert(is_pivot[v.second]);
        }
        cursum += (long long)(v.first);
      }
    }
    cout << max(0, ans) << "\n";
  }
}
