#include <bits/stdc++.h>
using namespace std;
const int INF = 1E9;
const int base = 1E9 + 7;
const int maxn = 3 * 100100;
int main() {
  int q;
  scanf("%d\n", &q);
  multiset<int> st[32];
  vector<long long> current(32, 0);
  int overall = 0;
  while (q--) {
    char type;
    int x;
    scanf("%c %d\n", &type, &x);
    if (type == '+') {
      overall++;
      for (int i = 0; i < 32; ++i) {
        if (x < (1 << (i + 1))) {
          st[i].insert(x);
          current[i] += x;
          break;
        }
      }
    } else {
      overall--;
      for (int i = 0; i < 32; ++i) {
        if (x < (1 << (i + 1))) {
          st[i].erase(st[i].find(x));
          current[i] -= x;
          break;
        }
      }
    }
    long long total = 0;
    int ans = overall - 1;
    for (int i = 0; i < 32; ++i) {
      if (!st[i].empty()) {
        int mn = *st[i].begin();
        if (total > 0 && 2ll * total < mn) {
          ans--;
        }
      }
      total += current[i];
    }
    printf("%d\n", max(ans, 0));
  }
  return 0;
}
