#include #define N 1000000007 #define maxs 100005 #define mins 1005 #define pf printf #define sc scanf #define ll long long #define pb push_back using namespace std; ll power(ll a,ll b) { ll t=1; while(b>0){ if(b&1){ t=t*a; } a=a*a; b>>=1; } return t; } ll modpow(ll a,ll b,ll c) { ll t=1; while(b>0){ if(b&1){ t=((t%c)*(a%c))%c; } a=((a%c)*(a%c))%c; b>>=1; } return t; } int marked[maxs]; void prime(int n){ int i,j; for(i=2;i<=n;i++){ if(!marked[i]) { int cnt=2; for(j=i*cnt;j<=n;j=i*cnt){ marked[j]=1; cnt++; } } } } int main() { int t; sc("%d",&t); prime(100000); while(t--){ int n; sc("%d",&n); int i; int cnt=0; for(i=2;i<=n;i++){ if(!marked[i]) cnt++; } //cout<