#include <bits/stdc++.h>
using namespace std;
long long n, ans;
inline long long read() {
  register long long w = 0, X = 0;
  register char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) {
    X = (X << 1) + (X << 3) + (ch ^ 48);
    ch = getchar();
  }
  return w ? -X : X;
}
struct papa {
  multiset<long long> S;
  long long sum;
  papa() {
    S.clear();
    sum = 0;
  }
} a[33];
int main() {
  n = read();
  for (register long long i = 1; i <= n; i++) {
    register char ch = 0;
    while (ch != '+' && ch != '-') ch = getchar();
    register long long now = 0, x = read();
    register long long pos = log2(x);
    if (ch == '+') {
      a[pos].sum += x;
      a[pos].S.insert(x);
    } else {
      a[pos].sum -= x;
      a[pos].S.erase(a[pos].S.lower_bound(x));
    }
    ans = 0;
    for (register long long i = 0; i <= 32; i++) {
      ans += a[i].S.size();
      if (!a[i].S.empty() && *(a[i].S.begin()) > (now << 1)) ans--;
      now += a[i].sum;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
