#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-13;
const long double PI = acos(-1);
const int INF = (int)1e9;
const long long INFF = (long long)1e15;
const int mod = 998244353;
const int MXN = (int)5e2 + 7;
long long sum[37];
int mn[37];
multiset<int> st[37];
int sol() {
  int res = 0;
  long long val = 0;
  for (int i = 0; i <= 30; i++) {
    if (st[i].empty()) continue;
    if (val * 2 < mn[i]) res++;
    val += sum[i];
  }
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  int cur = 0;
  for (int i = 1; i <= n; i++) {
    char typ[3];
    int v;
    scanf("%s %d", typ, &v);
    int p = 30;
    while (!((v >> p) & 1)) p--;
    if (typ[0] == '-') {
      sum[p] -= v;
      st[p].erase(st[p].find(v));
      cur--;
    } else {
      sum[p] += v;
      st[p].insert(v);
      cur++;
    }
    if (st[p].empty())
      mn[p] = -1;
    else
      mn[p] = *st[p].begin();
    int ans = cur - sol();
    printf("%d\n", ans);
  }
  return 0;
}
