#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<algorithm>
using namespace std;
const int maxn = 1e5 + 50;
int main()
{
int p[1005], sum[1005];
p[1] = 0;
p[2] = 1;
for(int i=3;i<=1000;i++)
{
int flag = 1;
for(int j = 2;j*j<=i;j++)
{
if(i % j == 0)flag = 0;
}
if(!flag) p[i] = 0;
else p[i] = 1;
}
sum[2] = 1;
for(int i=3;i<=1000;i++)
{
sum[i] = sum[i-1] + p[i];
}
int t;
scanf("%d", &t);
while(t--)
{
int n;
scanf("%d", &n);
printf("%d\n", sum[n]);
}
return 0;
}