fact(n) refers to n×(n−1)×⋯×3×2×1

Example, fact(10)=9×⋯×3×2×1=3628800,
and the summation of the digits of fact(10) is 3+6+2+8+8+0+0=27.
Write your program to find the summation of the digits of fact(N).

Input Format

The first line contains an integer T , i.e., number of test cases.
Next T lines will contain an integer N.

Output Format

Print the values corresponding to each test case.

Constraints

1≤T≤100
0≤N≤1000

SAMPLE INPUT
2
3
6

SAMPLE OUTPUT
6
9
t=input()
for i in range(t):
    n=(int)(input())
    f=1
    for j in range(1,n+1):
        f=f*j   
    s=0   
    while(f!=0):
        d=f%10
        s=s+d
        f=f/10
    print(s)