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