/*
log10(12*13)=log10(12)+log10(13)=2
*/
#include<stdio.h>
#include<math.h>
int main()
{
int zushu,n,i;
double sum;
scanf("%d",&zushu);
while(zushu--)
{
scanf("%d",&n);
sum=0;
for(i=1;i<=n;++i)
sum+=(double)log10(i);
printf("%d\n",(int)sum+1);
}
return 0;
}
log10(12*13)=log10(12)+log10(13)=2
*/
#include<stdio.h>
#include<math.h>
int main()
{
int zushu,n,i;
double sum;
scanf("%d",&zushu);
while(zushu--)
{
scanf("%d",&n);
sum=0;
for(i=1;i<=n;++i)
sum+=(double)log10(i);
printf("%d\n",(int)sum+1);
}
return 0;
}