#include <bits/stdc++.h>
using namespace std;
int q;
multiset<int> fsh[55];
long long su[55];
int main() {
  scanf("%d", &q);
  while (q--) {
    char str[5];
    int val;
    scanf("%s%d", str, &val);
    if (str[0] == '+') {
      int tp = val;
      int id = 0;
      while (tp) tp >>= 1, id++;
      fsh[id].insert(val);
      su[id] += val;
    } else {
      int tp = val;
      int id = 0;
      while (tp) tp >>= 1, id++;
      fsh[id].erase(fsh[id].find(val));
      su[id] -= val;
    }
    int cn = 0;
    long long pr = 0;
    for (int i = 1; i <= 32; ++i) {
      cn += fsh[i].size();
      if (fsh[i].size())
        if (*fsh[i].begin() > pr * 2) cn--;
      pr += su[i];
    }
    printf("%d\n", cn);
  }
}
