#include <iostream>
#include <vector>

using namespace std;
vector<long long> v[100010];
int a[100010] = {};
int main(){
	int i,j,q;
	for(i=1;i<=100000;i++){
		for(j=i;j<=100000;j+=i){
			v[j].push_back(i);
		}
	}
	for(i=1;i<=100000;i++){
		a[i] = a[i-1];
		long long res = 1;
		for(j=0;j<v[i].size() - 1;j++){
			res *= v[i][j];
			if(res>=2*(long long)i){
				a[i]++;
				break;
			}
		}
	}
	cin >> q;
	for(i=0;i<q;i++){
		int n; cin >> n;
		cout << a[n] << endl;
	}
}
