#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1e13;
int main() {
    int Q;
    cin >> Q;
    const int MAX = 100001;
    vector<ll> table(MAX, 1), done(MAX), acc(MAX);
    for(int i = 2; i < MAX; ++i) {
        for(int j = i * 2; j <= MAX; j += i) {
            if(!done[j]) {
                table[j] *= i;
                if(table[j] >= j * 2) done[j] = 1;
            }
        }
    }
    for(int i = 1; i <= MAX; ++i)
        acc[i] = acc[i - 1] + done[i];
    while(Q--) {
        ll N;
        cin >> N;
        cout << acc[N] << endl;
    }
    return 0;
}
