A=[1]*(10**5+3) A[0]=0 A[1]=0 for i in range(10**5+3): if A[i]==1: for j in range(i+i,10**5+3,i): A[j]=0 S=[0]*(10**5+3) for i in range(1,10**5+3): S[i]=S[i-1]+A[i] T=int(input()) for tests in range(T): print(S[int(input())])