#include <stdio.h>
#include <stdlib.h>

int main()
{
	int testcase, i;

	scanf("%d", &testcase);	
	for (i=0; i<testcase; i++)
	{
		int num, j=2, count = 0;				
		scanf("%d", &num);

		int* check = (int*) malloc(sizeof(int)*num);			

		int k;
		for (k=0; k<num; k++)
		{
			check[num] = 0;
		}

		if (num == 2)
		{
			count++;
		}
		for (j=j; j<num; j++) 
		{
			if (check[j] == 1)
				continue;
			
			count++;

			int l;		
			for (l=2; l * j < num; l++)
			{				
				check[j * l] = 1;
			}			
		}
		printf("%d\n", count);
		free(check);
	}

	return 0;
}