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