Understand the **INPUT** section of the problem clearly:

*The input file will contain one or more test cases. Each test case consists of one line containing an integers n (n<=1000).*

Here first number in the input does not indicate number of testcases. So you have read the numbers until **EOF**.

Also always remember to read input from **STDIN** and write output to **STDOUT**.

My primary language in not Python but I tried solving this problem in python but for some reason I get NZEC error (If somebody finds the error feel free to edit the code), but still it might help you.

```
import sys
def calcSum(t) :
q = 0
while (t > 0) :
q = q + int(t % 10)
t = t // 10
print q
fact = []
for i in range(1001) :
fact.append(1)
for i in range(2, 1001) :
fact[i] = fact[i-1] * i
while True :
inp = 0
try:
inp = int(raw_input())
calcSum(fact[inp])
except EOFError:
break
```

Hope it helps, Best Luck