public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
int primes[]={2,3,5,7,11,13,17,19};
int t=sc.nextInt();
int aswer =0;
while(t>=0){
int n= sc.nextInt();
int subsets =(1<<8)-1;
for (int i=1;i<=subsets;i++){
int denom=1;
int setBits = Integer.bitCount(i);
for(int j=0;j<8;j++){
if((i &(1<<j))==1)
denom = denom* primes[j];
}
if((setBits&1)==1)
aswer = aswer+(n/denom);
else
aswer = aswer-(n/denom);
}
System.out.println(aswer);
t–;
}
}