{  ACM International Collegiate Programming Contest
   Central European Regional Contest 2000
   
   Problem F - Factorial
   Martin Kacer
}
   
Program Factorial;
Var TaskCnt, TaskNum : Integer;
	Number, Powers	 : Integer;
	Fives			 : Integer;
Begin
	Readln (TaskCnt);
	For TaskNum:= 1 to TaskCnt do
	Begin
		ReadLn (Number);
		Fives:= 0;
		Powers:= 5;
		While (Powers <= Number) do Begin
			Fives:= Fives + (Number div Powers);
			Powers:= Powers * 5;
		End;
		WriteLn (Fives);
	End;
End.
