#include <bits/stdc++.h>
using namespace std;
const int LOG = 31;
static int Q;
static long long sum[LOG];
static multiset<int> fish[LOG];
inline int get_log(int x) {
  int j = 0;
  while ((1 << j) < x) j++;
  return j;
}
int main(int argc, char *argv[]) {
  scanf("%d", &Q);
  while (Q--) {
    static char op[2];
    static int x, log;
    scanf("%s%d", op, &x);
    log = get_log(x);
    if (op[0] == '-') {
      auto it = fish[log].find(x);
      fish[log].erase(it);
      sum[log] -= x;
    } else {
      fish[log].insert(x);
      sum[log] += x;
    }
    long long pre = 0;
    int cnt = 0;
    for (int i = 0; i < LOG; i++) {
      cnt += fish[i].size();
      if (!fish[i].empty() && *fish[i].begin() > (pre << 1)) cnt--;
      pre += sum[i];
    }
    printf("%d\n", cnt);
  }
  return 0;
}
