#include <bits/stdc++.h>
using namespace std;
const int P = 31;
vector<multiset<int>> eels(P);
vector<long long> sums(P, 0);
int get(int w) {
  int i = 0;
  while ((1 << i) <= w) {
    ++i;
  }
  return i - 1;
}
void push_back(int w) {
  int seg = get(w);
  eels[seg].emplace(w);
  sums[seg] += w;
}
void remove(int w) {
  int seg = get(w);
  eels[seg].erase(eels[seg].find(w));
  sums[seg] -= w;
}
void solve() {
  int total = 0, heavy = 0;
  long long sum = 0;
  for (int i = 0; i < P; ++i) {
    if (eels[i].size() and *eels[i].begin() > 2 * sum) {
      ++heavy;
    }
    sum += sums[i];
    total += eels[i].size();
  }
  cout << total - heavy << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  while (q--) {
    char c;
    int w;
    cin >> c >> w;
    if (c == '+') {
      push_back(w);
    } else {
      remove(w);
    }
    solve();
  }
  return 0;
}
