#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 1e18
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define seg_size 262144
#define REP(i,n) for(long long i = 0;i < n;++i)
long long ans[200000] = {};
vector<int> sosuu;
int sosuu_grid[200000];
int main() {
#define int long long
	for (int i = 2; i <= 100000; ++i) {
		ans[i] += ans[i - 1];
		int geko = 1;
		for (int q = 2; q <= sqrt(i); ++q) {
			if (i % q == 0) {
				geko *= q;
				if (i / q != q) {
					geko *= i/q;
				}
				if (geko >= 2 * i) break;
			}
		}
		if (geko >= 2 * i) {
			ans[i]++;
		}
	}
	int query;
	cin >> query;
	REP(i, query) {
		int a;
		cin >> a;
		cout << ans[a] << endl;
	}
	return 0;
}
