#include <bits/stdc++.h>
using namespace std;
class Solution {
  multiset<int> S[64];
  long long sum[64];
  int sz = 0;
  int countFat() {
    long long acc = 0;
    int ans = 0;
    for (int i = 0; i < 40; ++i) {
      if (S[i].empty()) continue;
      int v = *S[i].begin();
      if (2 * acc < v) ++ans;
      acc += sum[i];
    }
    return ans;
  }

 public:
  void run(istream &in, ostream &out) {
    memset(sum, 0, sizeof(sum));
    int q;
    in >> q;
    string s;
    for (int i = 0; i < q; ++i) {
      int x;
      in >> s >> x;
      if (s == "+") {
        for (int j = 0; j < 40; ++j) {
          if ((1ll << j) <= x and x < (2ll << j)) {
            S[j].insert(x);
            sum[j] += x;
          }
        }
        ++sz;
        out << sz - countFat() << '\n';
      } else {
        for (int j = 0; j < 40; ++j) {
          if ((1ll << j) <= x and x < (2ll << j)) {
            S[j].erase(S[j].find(x));
            sum[j] -= x;
          }
        }
        --sz;
        out << sz - countFat() << '\n';
      }
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  Solution().run(cin, cout);
}
