n = gets().to_i()
while (n != 0)
  factorial = 1
  for i in 1..n
    factorial *= i
  end
  count = 0
  while (factorial % 10 == 0)
    count += 1
    factorial /= 10
  end
  puts(count)
  
  n = gets().to_i()
end