#include <bits/stdc++.h>
using namespace std;
int q;
int d;
multiset<int> minn[40];
long long sum[40];
int cnt;
int Calc(int d) {
  int s = 0;
  while (d != 0) {
    d /= 2;
    s++;
  }
  return s;
}
void Add(int d) {
  cnt++;
  int p = Calc(d);
  for (int i = p; i <= 31; i++) sum[i] += (long long)d;
  minn[p].insert(d);
}
void Del(int d) {
  cnt--;
  int p = Calc(d);
  for (int i = p; i <= 31; i++) sum[i] -= (long long)d;
  minn[p].erase(minn[p].find(d));
}
int Find() {
  int num = 0;
  for (int i = 1; i <= 31; i++)
    if (minn[i].size() != 0)
      if (*(minn[i].begin()) > 2 * sum[i - 1]) num++;
  return num;
}
int main() {
  cin >> q;
  string s;
  while (q--) {
    cin >> s >> d;
    if (s[0] == '+')
      Add(d);
    else
      Del(d);
    cout << cnt - Find() << endl;
  }
}
