#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
const int maxn=1010;
int a[maxn];
int main ()
{
memset(a,0,sizeof(a));
a[1]=0;
for(int i=2;i<=1000;i++)
{
int lazy=0;
a[i]=a[i-1];
for(int j=2;j*j<=i;j++)
{
if(i%j==0)
{
lazy=1;
break;
}
}
if(lazy==0)
{
a[i]=a[i]+1;
}
}
int t;
scanf("%d",&t);
while(t--)
{
int x;
scanf("%d",&x);
printf("%d\n",a[x]);
}
}