#include <bits/stdc++.h>
struct Q {
  int i, x, x_;
} qq[500000];
int compare_x(const void *a, const void *b) {
  struct Q *p = (struct Q *)a;
  struct Q *q = (struct Q *)b;
  int px = abs(p->x), qx = abs(q->x);
  return px != qx ? px - qx : p->i - q->i;
}
int compare_i(const void *a, const void *b) {
  struct Q *p = (struct Q *)a;
  struct Q *q = (struct Q *)b;
  return p->i - q->i;
}
long long tt[(1 << 19) * 2], lz[(1 << 19) * 2];
void update(int k, int l, int r, int i, int x) {
  int m, k1, k2;
  if (i >= r) return;
  if (i < l) {
    tt[k] -= x * 2;
    lz[k] += x;
    return;
  }
  if (r - l == 1) {
    tt[k] += x;
    return;
  }
  m = (l + r) / 2, k1 = k * 2 + 1, k2 = k * 2 + 2;
  if (lz[k]) {
    tt[k1] -= lz[k] * 2;
    lz[k1] += lz[k];
    tt[k2] -= lz[k] * 2;
    lz[k2] += lz[k];
    lz[k] = 0;
  }
  update(k1, l, m, i, x);
  update(k2, m, r, i, x);
  tt[k] = tt[k1] > tt[k2] ? tt[k1] : tt[k2];
}
int query(int k, int l, int r) {
  int m, k1, k2;
  if (tt[k] <= 0) return 0;
  if (r - l == 1) return 1;
  m = (l + r) / 2, k1 = k * 2 + 1, k2 = k * 2 + 2;
  if (lz[k]) {
    tt[k1] -= lz[k] * 2;
    lz[k1] += lz[k];
    tt[k2] -= lz[k] * 2;
    lz[k2] += lz[k];
    lz[k] = 0;
  }
  return query(k1, l, m) + query(k2, m, r);
}
int main() {
  int n, h, i, j, x, x_, n_, cnt;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    struct Q *q = &qq[i];
    static char s[2];
    scanf("%s%d", s, &x);
    q->i = i, q->x = s[0] == '+' ? x : -x;
  }
  qsort(qq, n, sizeof *qq, compare_x);
  for (i = 0, x_ = 0, n_ = 0; i < n; i = j, x_ = n_) {
    x = abs(qq[i].x);
    j = i + 1;
    while (j < n && abs(qq[j].x) == x) j++;
    for (h = i; h < j; h++)
      if (qq[h].x > 0) {
        qq[h].x_ = x_++;
        if (n_ < x_) n_ = x_;
      } else
        qq[h].x_ = --x_;
  }
  qsort(qq, n, sizeof *qq, compare_i);
  cnt = 0;
  for (i = 0; i < n; i++) {
    struct Q *q = &qq[i];
    update(0, 0, n_, q->x_, q->x);
    cnt += q->x > 0 ? 1 : -1;
    printf("%d\n", cnt - query(0, 0, n_));
  }
  return 0;
}
