#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int squ[224],ans[50001];
int main(void)
{
freopen("wang.in","r",stdin);
freopen("wang.out","w",stdout);
int times,i,j,T,n;
for (i=1;i<224;i++)
squ[i]=i*i;
for (i=1;i<224;i++)
{
ans[squ[i]]=ans[squ[i]-1]+1;
for (j=squ[i]+1;j<squ[i+1];j++)
{
ans[j]=ans[j-1];
}
}
cin>>T;
for (times=1;times<=T;times++)
{
cin>>n;
cout<<ans[n]<<endl;
}
return(0);
}