#include<stdio.h>
int A[100000000] ={0};
int sushu(int n){
int i,j,s=0;
int f=0;
A[2]=1;
if(A[n]==0){
for(i=2;i<=n/2;++i){
if(n%i==0){
f=1;
break;}
}
if(f==0)
s+=1;
A[n]=sushu(n-1)+s;
}
return A[n];
}
int main(void){
long t;
int n;
int s;
scanf("%ld",&t);
while(t--){
scanf("%d",&n);
s=sushu(n);
printf("%d\n",s);
}
return 0;
}