#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int cur = 0;
  long long po[30];
  set<pair<long long, int> > li[30];
  long long a[30];
  long long f[30];
  po[0] = 1LL;
  a[0] = 0LL;
  f[0] = -1LL;
  for (int i = 1; i < 30; i++) {
    po[i] = po[i - 1] * 2LL;
    a[i] = 0LL;
    f[i] = -1LL;
  }
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    long long v;
    cin >> v;
    int id = -1;
    for (int j = 29; i >= 0; j--) {
      if (po[j] <= v) {
        id = j;
        break;
      }
    }
    if (s == "+") {
      cur++;
      a[id] += v;
      li[id].insert(make_pair(v, i + 1));
      f[id] = (*li[id].begin()).first;
    } else {
      cur--;
      a[id] -= v;
      auto it = li[id].upper_bound(make_pair(v, 0));
      li[id].erase(it);
      if (li[id].size() == 0) {
        f[id] = -1;
      } else {
        f[id] = (*li[id].begin()).first;
      }
    }
    int ans = cur;
    long long bef = 0LL;
    for (int j = 0; j < 30; j++) {
      if (bef * 2LL < f[j]) {
        ans--;
      }
      bef += a[j];
    }
    cout << ans << endl;
  }
}
