#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  vector<multiset<int>> bucket(32);
  vll bsum(32);
  int Q, E = 0;
  cin >> Q;
  for (int q = 0; q < Q; q++) {
    char op;
    int eel;
    cin >> op >> eel;
    int b = 31 - __builtin_clz(eel);
    if (op == '+') {
      bsum[b] += eel;
      bucket[b].insert(eel);
      E++;
    } else {
      bsum[b] -= eel;
      bucket[b].erase(bucket[b].find(eel));
      E--;
    }
    int ans = E;
    ll tot = 0;
    for (int i = 0; i < 32; i++) {
      if (!bucket[i].empty() && *bucket[i].begin() > 2 * tot) ans--;
      tot += bsum[i];
    }
    cout << ans << "\n";
  }
  return 0;
}
