Find how many n are here such that n! has 1998 zeros at the end of n!.
The could be 5 n values that satisfy the property and they are 8000, 8001, 8002, 8003 and 8004.
This is because if n! has 1998 zeros and n is smallest integer it could only be 5.From the formula it is also seen that only n,n+1,n+2,n+3,n+4 satisfy the conditions hence by checking n as 8000,the value of Z will come to 1600+320+64+12+2=1998.