n = int(input()) for i in range(n): a = int(input()) j = a i = 0 while j > 0: i += j//5 j //= 5 print(i)