#include <bits/stdc++.h>
using namespace std;
const int NMAX = 1e5;
multiset<int> stuff[35];
long long sum[35];
int numara() {
  long long total = 0, sol = 0;
  for (int i = 1; i <= 32; ++i) {
    total += sum[i - 1];
    if (stuff[i].empty()) continue;
    int val = *stuff[i].begin();
    if (val > 2 * total && total > 0) ++sol;
  }
  return sol;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int Q, cate = 0;
  cin >> Q;
  while (Q--) {
    char ch;
    int nr;
    cin >> ch >> nr;
    int where = 0, cop = nr;
    while (nr) {
      ++where;
      nr >>= 1;
    }
    if (ch == '+')
      stuff[where].insert(cop), sum[where] += cop, ++cate;
    else
      stuff[where].erase(stuff[where].find(cop)), sum[where] -= cop, --cate;
    cout << max(cate - numara() - 1, 0) << '\n';
  }
  return 0;
}
