#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
int q;
long long sum[35];
char opt[5];
multiset<long long> s[35];
int main() {
  read(q);
  while (q--) {
    long long v, x = 0, val = 0, ans = 0;
    scanf("%s", opt), read(v);
    while ((1 << (x + 1)) <= v) x++;
    if (opt[0] == '+')
      s[x].insert(v), sum[x] += v;
    else
      s[x].erase(s[x].find(v)), sum[x] -= v;
    for (int i = 0; i <= 30; ++i)
      ans += s[i].size() - (*s[i].begin() > 2 * val), val += sum[i];
    printf("%lld\n", ans);
  }
  return 0;
}
