#include <bits/stdc++.h>
using namespace std;
long long n, sum[31], sum1[31];
set<long long> s[31];
map<long long, long long> d[31];
long long getid(long long o) { return log2(o); }
signed main() {
  scanf("%lld", &n);
  for (long long i = 0; i <= 30; i++) sum1[i] = sum[i] = 0;
  for (long long i = 1; i <= n; i++) {
    char ch = getchar();
    long long x;
    while ((ch != '+') && (ch != '-')) ch = getchar();
    scanf("%lld", &x);
    if (ch == '+') {
      s[getid(x)].insert(x);
      d[getid(x)][x]++;
      sum[getid(x)] += x;
      sum1[getid(x)]++;
    } else {
      sum[getid(x)] -= x;
      sum1[getid(x)]--;
      if (d[getid(x)][x] == 1) {
        s[getid(x)].erase(x);
        d[getid(x)].erase(x);
      } else
        d[getid(x)][x]--;
    }
    long long ans = 0, s1 = 0;
    for (long long j = 0; j <= 30; j++) {
      ans += sum1[j];
      if (s1 && sum1[j] && (s1 * 2 < (*s[j].begin()))) ans--;
      s1 += sum[j];
    }
    if (!s1)
      puts("0");
    else
      printf("%lld\n", ans - 1);
  }
  return 0;
}
