#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
template <typename T>
inline istream& operator>>(istream& i, vector<T>& v) {
  for (int j = 0; j < ((int)(v).size()); ++j) i >> v[j];
  return i;
}
template <typename T>
string join(const vector<T>& v) {
  stringstream s;
  for (int i = 0; i < ((int)(v).size()); ++i) s << ' ' << v[i];
  return s.str().substr(1);
}
template <typename T>
inline ostream& operator<<(ostream& o, const vector<T>& v) {
  if ((int)(v).size()) o << join(v);
  return o;
}
template <typename T1, typename T2>
inline istream& operator>>(istream& i, pair<T1, T2>& v) {
  return i >> v.first >> v.second;
}
template <typename T1, typename T2>
inline ostream& operator<<(ostream& o, const pair<T1, T2>& v) {
  return o << v.first << "," << v.second;
}
template <typename T>
inline long long int suma(const vector<T>& a) {
  long long int res(0);
  for (auto&& x : a) res += x;
  return res;
}
const double eps = 1e-10;
const long long int LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MX = 200005;
int bsr(unsigned long long x) { return 63 ^ __builtin_clzll(x); }
int bsf(unsigned long long x) { return __builtin_ctzll(x); }
struct faset {
  int n, h;
  vector<vector<unsigned long long> > seg;
  faset() {}
  faset(int n) : n(n) {
    while (n > 1) {
      n = (n + 63) >> 6;
      seg.push_back(vector<unsigned long long>(n));
    }
    h = (int)(seg).size();
  }
  bool count(int x) const {
    int d = x >> 6, r = x & 63;
    return seg[0][d] >> r & 1;
  }
  void insert(int x) {
    for (int i = 0; i < (h); ++i) {
      unsigned long long b = 1ull << (x & 63);
      x >>= 6;
      seg[i][x] |= b;
    }
  }
  void erase(int x) {
    for (int i = 0; i < (h); ++i) {
      unsigned long long b = 1ull << (x & 63);
      x >>= 6;
      seg[i][x] &= ~b;
      if (seg[i][x]) break;
    }
  }
  int nxt(int x) {
    for (int i = 0; i < (h); ++i) {
      int d = x >> 6, r = x & 63;
      if (d == (int)(seg[i]).size()) break;
      unsigned long long s = seg[i][d] >> r;
      if (s) {
        x += bsf(s);
        while (i--) {
          x = x << 6 | bsf(seg[i][x]);
        }
        return x;
      }
      x = (x >> 6) + 1;
    }
    return -1;
  }
  int pre(int x) {
    for (int i = 0; i < (h); ++i) {
      if (x == -1) break;
      int d = x >> 6, r = x & 63;
      unsigned long long s = seg[i][d] << (63 ^ r);
      if (s) {
        x -= 63 ^ bsr(s);
        while (i--) {
          x = x << 6 | bsr(seg[i][x]);
        }
        return x;
      }
      x = (x >> 6) - 1;
    }
    return -1;
  }
};
struct bit {
  int n;
  vector<long long int> d;
  bit() {}
  bit(int mx) {
    n = 1;
    while (n < mx) n <<= 1;
    d = vector<long long int>(n + 1);
  }
  void add(int i, long long int x) {
    for (++i; i <= n; i += i & -i) d[i] += x;
  }
  long long int sum(int i) {
    long long int x = 0;
    for (++i; i; i -= i & -i) x += d[i];
    return x;
  }
  long long int r;
  int nxt(long long int x) {
    r = x;
    int i = 0;
    int w = n >> 1;
    while (w) {
      if (d[i | w] <= x) {
        i |= w;
        x -= d[i];
      }
      w >>= 1;
    }
    r -= x;
    return i;
  }
};
struct X {
  vector<int> d;
  X() {}
  void add(int x) { d.push_back(x); }
  void init() {
    sort(d.begin(), d.end());
    d.erase(unique(d.begin(), d.end()), d.end());
  }
  int size() const { return (int)(d).size(); }
  int operator[](int i) const { return d[i]; }
  int operator()(int x) const {
    return upper_bound(d.begin(), d.end(), x) - d.begin() - 1;
  }
};
int main() {
  int qn;
  scanf("%d", &qn);
  vector<int> q;
  X xs;
  for (int qi = 0; qi < (qn); ++qi) {
    char c;
    int a;
    scanf(" %c%d", &c, &a);
    xs.add(a);
    if (c == '-') a = -a;
    q.push_back(a);
  }
  xs.init();
  int n = (int)(xs).size();
  bit d(n + 2);
  vector<int> cs(n + 1);
  faset s(n + 1);
  faset bs(n + 1);
  vector<long long int> w(n + 1);
  auto check = [&](int i) {
    int j = s.pre(i - 1);
    if (j == -1 || xs[j] * 2 >= xs[i]) {
      bs.erase(i);
    } else {
      bs.insert(i);
      w[i] = d.sum(i - 1);
    }
  };
  int cnt = 0;
  for (int qi = 0; qi < (qn); ++qi) {
    int a = q[qi];
    int i = xs(abs(a));
    if (a < 0)
      --cnt;
    else
      ++cnt;
    if (!cs[i]) {
      s.insert(i);
      check(i);
    }
    if (a < 0)
      --cs[i];
    else
      ++cs[i];
    if (!cs[i]) {
      if (bs.count(i)) bs.erase(i);
      s.erase(i);
    }
    {
      int j = s.nxt(i + 1);
      if (j != -1) check(j);
    }
    d.add(i, a);
    {
      int j = i;
      while (1) {
        j = bs.nxt(j + 1);
        if (j == -1) break;
        w[j] += a;
      }
    }
    int ans = cnt - 1;
    {
      int j = -1;
      while (1) {
        j = bs.nxt(j + 1);
        if (j == -1) break;
        if (w[j] * 2 < xs[j]) ans--;
      }
    }
    printf("%d\n", max(ans, 0));
  }
  return 0;
}
