#include <bits/stdc++.h>
using namespace std;
int q, o[500005], p[500005], n, a[500005];
long long s[500005 * 4], t, mn[500005 * 4], tag[500005 * 4];
void init(int k, int l, int r) {
  mn[k] = 500000000000005LL;
  if (l == r) return;
  int mid = (l + r) >> 1;
  init(k * 2, l, mid);
  init(k * 2 + 1, mid + 1, r);
}
void pd(int k) {
  if (mn[k * 2] < 500000000000005LL) mn[k * 2] += tag[k];
  tag[k * 2] += tag[k];
  if (mn[k * 2 + 1] < 500000000000005LL) mn[k * 2 + 1] += tag[k];
  tag[k * 2 + 1] += tag[k];
  tag[k] = 0;
}
void upd0(int k, int l, int r, int x, int y) {
  if (x <= l) {
    if (mn[k] < 500000000000005LL) mn[k] += y;
    tag[k] += y;
    return;
  }
  if (tag[k]) pd(k);
  int mid = (l + r) >> 1;
  if (x <= mid) upd0(k * 2, l, mid, x, y);
  upd0(k * 2 + 1, mid + 1, r, x, y);
  mn[k] = min(mn[k * 2], mn[k * 2 + 1]);
}
void upd1(int k, int l, int r, int x, int y) {
  if (l == r) {
    s[k] += a[l] * y;
    if (s[k])
      mn[k] = t * 2 - a[l];
    else
      mn[k] = 500000000000005LL;
    if (l < n) upd0(1, 1, n, l + 1, a[l] * y * 2);
    return;
  }
  if (tag[k]) pd(k);
  int mid = (l + r) >> 1;
  if (x <= mid)
    upd1(k * 2, l, mid, x, y);
  else
    t += s[k * 2], upd1(k * 2 + 1, mid + 1, r, x, y);
  s[k] = s[k * 2] + s[k * 2 + 1];
  mn[k] = min(mn[k * 2], mn[k * 2 + 1]);
}
int ans;
void solve(int k, int l, int r) {
  if (l == r) {
    if (mn[k] < 0) --ans;
    return;
  }
  if (tag[k]) pd(k);
  int mid = (l + r) >> 1;
  if (mn[k * 2] < 0) solve(k * 2, l, mid);
  if (mn[k * 2 + 1] < 0) solve(k * 2 + 1, mid + 1, r);
}
int main() {
  scanf("%d", &q);
  for (int i = 1; i <= q; ++i) {
    char ch = getchar();
    while (ch != '+' && ch != '-') ch = getchar();
    o[i] = ch == '+' ? 1 : -1;
    scanf("%d", &p[i]);
    a[i] = p[i];
  }
  sort(a + 1, a + q + 1);
  n = unique(a + 1, a + q + 1) - a - 1;
  init(1, 1, n);
  for (int i = 1, j = 0; i <= q; ++i) {
    t = 0, upd1(1, 1, n, lower_bound(a + 1, a + n + 1, p[i]) - a, o[i]);
    ans = (j += o[i]), solve(1, 1, n);
    printf("%d\n", ans);
  }
}
