#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
int const N = 5e5 + 20;
int q;
char ch[N];
int x[N];
vector<int> vec;
ll fen[N];
set<pii> st;
inline void add(int p, int val) {
  for (p++; p < N; p += p & -p) fen[p] += val;
}
inline ll get(int p) {
  ll sum = 0;
  for (; p; p -= p & -p) sum += fen[p];
  return sum;
}
int seg[N << 2];
void add_s(int p, int val, int v = 1, int s = 0, int e = N) {
  if (e - s == 1) {
    seg[v] += val;
    return;
  }
  if (p < (s + e) >> 1)
    add_s(p, val, (v << 1), s, (s + e) >> 1);
  else
    add_s(p, val, ((v << 1) ^ 1), (s + e) >> 1, e);
  seg[v] = seg[(v << 1)] + seg[((v << 1) ^ 1)];
}
int get_s(int p, int v = 1, int s = 0, int e = N) {
  if (!seg[v]) return -1;
  if (e - s == 1) {
    if (seg[v]) return s;
    return -1;
  }
  int ans = -1;
  if (p < (s + e) >> 1 && seg[(v << 1)])
    ans = get_s(p, (v << 1), s, (s + e) >> 1);
  if (ans == -1 && seg[((v << 1) ^ 1)])
    ans = get_s(p, ((v << 1) ^ 1), (s + e) >> 1, e);
  return ans;
}
int main() {
  scanf("%d ", &q);
  for (int i = 0; i < q; i++) {
    scanf("%c ", &ch[i]);
    scanf("%d ", &x[i]);
    vec.push_back(x[i]);
  }
  sort(vec.begin(), vec.end());
  vec.resize(unique(vec.begin(), vec.end()) - vec.begin());
  int cur = 0;
  for (int i = 0; i < q; i++) {
    int id = lower_bound(vec.begin(), vec.end(), x[i]) - vec.begin();
    if (ch[i] == '+')
      add(id, x[i]), add_s(id, 1), cur++;
    else
      add(id, -x[i]), add_s(id, -1), cur--;
    int ans = cur;
    int p = get_s(0);
    while (p != -1) {
      int x = vec[p];
      int id = p;
      ll v = 2 * get(id);
      if (v < x) ans--;
      ll y = v + 2 * x + 1;
      id = lower_bound(vec.begin(), vec.end(), y) - vec.begin();
      p = get_s(id);
    }
    printf("%d\n", ans);
  }
}
