#include <bits/stdc++.h>
using namespace std;
template <class T>
using min_pq = priority_queue<T, vector<T>, greater<T>>;
const int MAXN = 5e5 + 10, MAXQ = 3e5 + 10, MAXL = 31, ALP = 26, MOD = 1e9 + 7,
          MAXK = 17, MAXA = 30, MAXB = 24, MAXBB = (1 << MAXB);
const string no = "NO\n", yes = "YES\n";
const int hA[4] = {1, 0, -1, 0}, kA[4] = {0, 1, 0, -1};
const long long INF = 1e18 + 10;
void solve() {
  int q;
  cin >> q;
  long long sm[MAXL] = {};
  multiset<long long> s[MAXL];
  int cnt = 0;
  while (q--) {
    char c;
    cin >> c;
    long long x;
    cin >> x;
    cnt += (c == '+' ? 1 : -1);
    for (int i = 0; i < MAXL; i++) {
      long long lb = 1ll << i, rb = (1ll << (i + 1)) - 1;
      if (lb <= x && x <= rb) {
        if (c == '+')
          s[i].insert(x), sm[i] += x;
        else
          s[i].erase(s[i].find(x)), sm[i] -= x;
        break;
      }
    }
    if (!cnt) {
      cout << 0 << '\n';
      continue;
    }
    int ans = cnt;
    long long ps = 0;
    for (int i = 0; i < MAXL; i++) {
      if ((int)s[i].size()) {
        long long c = *s[i].begin();
        if (c > 2 * ps) ans--;
      }
      ps += sm[i];
    }
    cout << ans << '\n';
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t_c = 1;
  while (t_c--) solve();
}
