#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
using namespace std;
const int MX = 500 * 1000 + 7;
const int MAX = 1000 * 1000 * 1000 + 7;
long long t[4 * MX];
void c(int v, int tl, int tr, int pos, int val) {
  if (tl == tr) {
    t[v] += val;
  } else {
    int tm = (tl + tr) >> 1;
    if (pos <= tm) {
      c(v + v, tl, tm, pos, val);
    } else {
      c(v + v + 1, tm + 1, tr, pos, val);
    }
    t[v] = t[v + v] + t[v + v + 1];
  }
}
int pos(int v, int tl, int tr, long long x) {
  if (t[v] < x) {
    return -1;
  } else if (tl == tr) {
    return tl;
  } else {
    int tm = (tl + tr) >> 1;
    if (x <= t[v + v]) {
      return pos(v + v, tl, tm, x);
    } else {
      return pos(v + v + 1, tm + 1, tr, x - t[v + v]);
    }
  }
}
long long gt(int v, int tl, int tr, int l, int r) {
  if (r < tl || l > tr) {
    return 0;
  } else if (tl >= l && tr <= r) {
    return t[v];
  } else {
    int tm = (tl + tr) >> 1;
    return gt(v + v, tl, tm, l, r) + gt(v + v + 1, tm + 1, tr, l, r);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int> > qq;
  vector<int> xx;
  for (int i = 0; i < n; i++) {
    char c;
    int x;
    cin >> c >> x;
    xx.push_back(x);
    if (c == '+') {
      qq.emplace_back(1, x);
    } else {
      qq.emplace_back(-1, x);
    }
  }
  sort(xx.begin(), xx.end());
  xx.resize(unique(xx.begin(), xx.end()) - xx.begin());
  int sz = 0;
  multiset<int> in;
  for (const auto& q : qq) {
    int rx = lower_bound(xx.begin(), xx.end(), q.second) - xx.begin() + 1;
    if (q.first == 1) {
      c(1, 1, n, rx, q.second);
      in.insert(q.second);
      sz++;
    } else {
      in.erase(in.find(q.second));
      c(1, 1, n, rx, -q.second);
      sz--;
    }
    if (sz == 0) {
      cout << 0 << "\n";
      continue;
    }
    int bad = 1;
    long long sm = *in.begin();
    ;
    while (true) {
      int v = pos(1, 1, n, 3 * sm + 1);
      if (v == -1) {
        break;
      }
      if (xx[v - 1] != *in.begin() && xx[v - 1] > 2ll * gt(1, 1, n, 1, v - 1)) {
        bad++;
      }
      sm = gt(1, 1, n, 1, v);
      if (sm > MAX) {
        break;
      }
    }
    cout << sz - bad << "\n";
  }
  return 0;
}
