/*
	HDOJ1018
	纯数学题
	求出N!的位数
	重点:递推 
*/ 

#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <sstream>
using namespace std;

#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
#define For1(i,a,b) for (i=a;i<b;i++)
#define For2(i,a,b) for (i=a;i<=b;i++)
#define Dec(i,a,b) for (i=a;i>b;i--)
#define Dec2(i,a,b) for (i=a;i>=b;i--)
#define Sca_d(x) scanf("%d",&x)
#define Sca_s(x) scanf("%s",x)
#define Sca_c(x) scanf("%c",&x)
#define Sca_f(x) scanf("%f",&x)
#define Sca_lf(x) scanf("%lf",&x)
#define Fill(x,a) memset(x,a,sizeof(x))
#define MAXN 0x7fffffff

int main()
{
	double ans;
	int n,t,i;
	cin>>t;
	while(t--)
	{
		ans=1;
		cin>>n;
		For2(i,1,n) ans+=log10(i);
		cout<<int(ans)<<endl;
	}
	return 0;
}