#include <bits/stdc++.h>
using namespace std;
long long sum[40];
multiset<int> s[40];
int tot, n, x, wh;
char tip, ch;
int seg(int x) {
  int p = 0;
  while (p <= 30 && (1 << p) <= x) p++;
  p--;
  return p;
}
int compute() {
  long long S = 0;
  int ret = tot;
  for (int i = 0; i <= 30; i++) {
    if (s[i].size() && 1LL * (*s[i].begin()) > 2LL * S) ret--;
    S += sum[i];
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int cnt = 1; cnt <= n; cnt++) {
    cin >> ch >> x;
    if (ch == '-') {
      wh = seg(x);
      s[wh].erase(s[wh].find(x));
      sum[wh] -= 1LL * x;
      tot--;
    } else {
      wh = seg(x);
      s[wh].insert(x);
      sum[wh] += 1LL * x;
      tot++;
    }
    cout << compute() << '\n';
  }
  return 0;
}
