#include <bits/stdc++.h>
using namespace std;
const int maxn = 500005;
int Q, ans;
struct interval {
  long long s, num, minn;
  int l, r;
  multiset<int> h;
} bit[35];
void ins(int x, int num) {
  bit[x].s += 1ll * num, bit[x].num++;
  if (num < bit[x].minn) bit[x].minn = num;
  bit[x].h.insert(num);
  if (bit[x].num > 1) ans++;
}
void dec(int x, int num) {
  bit[x].s -= 1ll * num, bit[x].num--;
  multiset<int>::iterator it;
  it = bit[x].h.find(num);
  bit[x].h.erase(it);
  if (bit[x].num >= 1)
    ans--, bit[x].minn = (*bit[x].h.begin());
  else
    bit[x].minn = (1ll << 60);
}
int main() {
  scanf("%d", &Q);
  for (int i = 0; i < 31; i++)
    bit[i].l = (1 << i), bit[i].r = (1 << i) + ((1 << i) - 1),
    bit[i].minn = (1ll << 60);
  while (Q--) {
    char ch = getchar();
    while (ch != '+' && ch != '-') ch = getchar();
    int x;
    scanf("%d", &x);
    if (ch == '+') {
      for (int i = 0; i < 31; i++)
        if (x >= bit[i].l && x <= bit[i].r) {
          ins(i, x);
          break;
        }
      int ans1 = 0;
      long long sum = bit[0].s;
      for (int i = 1; i < 31; i++) {
        if (bit[i].minn <= 2 * sum) ans1++;
        sum += bit[i].s;
      }
      printf("%d\n", ans + ans1);
    } else {
      for (int i = 0; i < 31; i++)
        if (x >= bit[i].l && x <= bit[i].r) {
          dec(i, x);
          break;
        }
      int ans1 = 0;
      long long sum = bit[0].s;
      for (int i = 1; i < 31; i++) {
        if (bit[i].minn <= 2 * sum) ans1++;
        sum += bit[i].s;
      }
      printf("%d\n", ans + ans1);
    }
  }
  return 0;
}
