#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

void input() {}
template <class T, class... Ts> void input(T &a, Ts &... as) {
  cin >> a;
  input(as...);
}
template <class V> istream &operator>>(istream &i, vector<V> &a) {
  for (auto &e : a)
    i >> e;
  return i;
}

void print() { cout << endl; }
template <class T> void print(T const &a) { cout << a << endl; }
template <class T, class... Ts> void print(T const &a, Ts const &... as) {
  cout << a << " ";
  print(as...);
}
using OS = ostream;
template <class F, class S> OS &operator<<(OS &o, pair<F, S> const &pair) {
  return o << "(" << pair.first << " : " << pair.second << ")";
}
template <size_t I, size_t N, class... Ts> struct OutputTuple;
template <> struct OutputTuple<1, 0> {
  OS &operator()(OS &o, tuple<> const &t) { return o; }
};
template <size_t N, class... Ts> struct OutputTuple<N, N, Ts...> {
  OS &operator()(OS &o, tuple<Ts...> const &t) { return o << get<N - 1>(t); }
};
template <size_t I, size_t N, class... Ts> struct OutputTuple {
  OS &operator()(OS &o, tuple<Ts...> const &t) {
    return OutputTuple<I + 1, N, Ts...>{}(o << get<I - 1>(t) << ",", t);
  }
};
template <class... Ts> OS &operator<<(OS &o, tuple<Ts...> const &t) {
  return OutputTuple<1, sizeof...(Ts), Ts...>{}(o << "(", t) << ")";
}
template <class C> ostream &outputContainer(OS &o, C const &a) {
  o << "[";
  for (auto i = a.begin(), e = a.end(); i != e; o << ((++i != e) ? ", " : ""))
    o << *i;
  return o << "]";
}
template <class V> OS &operator<<(OS &o, list<V> const &a) {
  return outputContainer(o, a);
}
template <class V> OS &operator<<(OS &o, vector<V> const &a) {
  return outputContainer(o, a);
}
template <class V> OS &operator<<(OS &o, set<V> const &a) {
  return outputContainer(o, a);
}
template <class V> OS &operator<<(OS &o, unordered_set<V> const &a) {
  return outputContainer(o, a);
}
template <class K, class V> OS &operator<<(OS &o, map<K, V> const &a) {
  return outputContainer(o, a);
}
template <class K, class V>
OS &operator<<(OS &o, unordered_map<K, V> const &a) {
  return outputContainer(o, a);
}

template <class Tuple, int I = tuple_size<Tuple>::value - 1> struct TupleHash {
  static size_t compute(size_t h, Tuple const &t) {
    auto v = get<I>(t);
    return TupleHash<Tuple, I - 1>::compute(h * 31 + hash<decltype(v)>{}(v), t);
  }
};
template <class Tuple> struct TupleHash<Tuple, -1> {
  static size_t compute(size_t h, Tuple const &tuple) { return h; }
};
namespace std {
template <typename... T> struct hash<tuple<T...>> {
  size_t operator()(tuple<T...> const &t) const {
    return TupleHash<tuple<T...>>::compute(17, t);
  }
};
} // namespace std

using lli = long long int;
lli gcd(lli const p, lli const q) { return q == 0 ? p : gcd(q, p % q); }
lli pow(lli const a, lli const n, lli const m) {
  return (!n) ? 1 : (n & 1) ? (((a % m) * pow(a, n - 1, m)) % m) : [=] {
    lli b = pow(a, n / 2, m);
    return (b * b) % m;
  }();
}
lli inv(lli const a, lli const p) { return pow(a, p - 2, p); }
constexpr lli MOD = 1e9 + 7;

int main() {
  lli N_MAX = 100000;
  vector<lli> ans(N_MAX + 1, 0);
  for (lli i = 1; i <= N_MAX; i++) {
    lli prod = 1;
    for (lli m = 2; m * m <= i; m++) {
      if (i % m == 0) {
        prod *= m;
      }
      if (m != (i / m) && m * (i / m) == i && i % (i / m) == 0) {
        prod *= i / m;
      }
      if (prod >= 2 * i) {
        ans[i]++;
        break;
      }
    }
  }

  for (int i = 1; i <= N_MAX; i++) {
    ans[i] += ans[i - 1];
  }
  lli Q;
  input(Q);
  vector<lli> N(Q);
  for (size_t i = 0; i < Q; i++) {
    input(N[i]);
  }

  for (size_t i = 0; i < Q; i++) {
    print(ans[N[i]]);
  }
}



Measured memory_bytes: 4408