#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(vector<T> a) {
  for (long long i = 0; i < a.size(); ++i) {
    cout << a[i] << ' ';
  }
  cout << "\n";
}
template <class T>
long long sum_vector(vector<T> v) {
  return accumulate(v.begin(), v.end(), 0ll);
}
void sort_vector(vector<int> &v) { sort(v.begin(), v.end()); }
void sort_comp(vector<int> &v, bool func(int, int)) {
  sort(v.begin(), v.end(), func);
}
bool comp(int a, int b) { return a > b; }
long long gcd(long long a, long long b) {
  a = abs(a);
  b = abs(b);
  while (a) {
    long long temp = a;
    a = b % a;
    b = temp;
  }
  return abs(b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
string binary(long long num) {
  string ans = "";
  do {
    ans = to_string(num % 2) + ans;
    num /= 2;
  } while (num);
  return ans;
}
const long long mxn = 1e5 + 17;
const int mill = 1e6 + 3;
const long long mod = 1e9 + 7;
long long pwr(long long num, long long p) {
  long long res = 1;
  while (p > 0) {
    if (p & 1) res = (res * num) % mod;
    num = (num * num) % mod;
    p /= 2;
  }
  return res;
}
long long inverse(long long num) { return pwr(num, mod - 2); }
void solve() {
  int q;
  cin >> q;
  char ch;
  long long x;
  long long aq;
  multiset<long long> aqua[33];
  long long sums[33] = {0};
  int eels = 0;
  int fat;
  long long cs;
  for (int i = 0; i < q; i++) {
    cin >> ch >> x;
    if (ch == '+') {
      aq = binary(x).size();
      aqua[aq].insert(x);
      sums[aq] += x;
      eels++;
    } else {
      aq = binary(x).size();
      aqua[aq].erase(aqua[aq].find(x));
      sums[aq] -= x;
      eels--;
    }
    fat = 0;
    cs = 0;
    for (int i = 1; i < 33; i++) {
      if (aqua[i].size() == 0) continue;
      if (*aqua[i].begin() > 2 * cs) fat++;
      cs += sums[i];
    }
    cout << eels - fat << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
