#include <bits/stdc++.h>
using std::multiset;
multiset<int> s[33];
long long pre[33];
int n, Q, cnt;
char ch;
int cal(int x) {
  int cnt = 0;
  while (x) {
    cnt++;
    x /= 2;
  }
  return cnt;
}
int solve() {
  long long sum = 0;
  int ans = 0;
  for (int i = 1; i <= 32; i++)
    if (s[i].size()) {
      int t = *s[i].begin();
      if (t > sum * 2) ans--;
      sum += pre[i];
    }
  return ans;
}
int main() {
  scanf("%d", &Q);
  while (Q--) {
    scanf(" %c", &ch);
    scanf("%d", &n);
    int x = cal(n);
    if (ch == '+') {
      cnt++;
      pre[x] += n;
      s[x].insert(n);
    } else {
      cnt--;
      pre[x] -= n;
      multiset<int>::iterator tt = s[x].find(n);
      s[x].erase(tt);
    }
    printf("%d\n", cnt + solve());
  }
}
