#include <bits/stdc++.h>
using namespace std;
const int maxn = 40;
multiset<int> val[maxn];
long long sum[maxn];
int q;
int main() {
  scanf("%d", &q);
  while (q--) {
    char op[2];
    int x;
    scanf("%s", op + 1);
    scanf("%d", &x);
    int p = 0, u = x;
    while (u) u >>= 1, p++;
    if (op[1] == '+') {
      sum[p] += x;
      val[p].insert(x);
    } else {
      sum[p] -= x;
      val[p].erase(val[p].find(x));
    }
    long long now = 0;
    int ans = 0;
    for (int i = 1; i <= 30; i++) {
      if (!val[i].size()) continue;
      ans += (val[i].size() - ((*val[i].begin()) > now * 2));
      now += sum[i];
    }
    printf("%d\n", ans);
  }
}
