#include <bits/stdc++.h>
using namespace std;
char ch;
int Q, x, n, ans, mn[32];
long long sum[32];
multiset<int> S[32];
int main() {
  for (scanf("%d", &Q); Q--;) {
    scanf(" %c%d", &ch, &x);
    int k = 0;
    for (; (1 << (k + 1)) <= x; k++)
      ;
    if (ch == '+')
      S[k].insert(x), n++, sum[k] += x;
    else
      S[k].erase(S[k].find(x)), n--, sum[k] -= x;
    mn[k] = *S[k].begin();
    long long sm = 0;
    ans = n;
    for (int i = (0); i <= (30); i++) {
      if (S[i].begin() != S[i].end()) ans -= (mn[i] > 2 * sm);
      sm += sum[i];
    }
    printf("%d\n", ans);
  }
  return 0;
}
