object Main extends App {
  val src: List[Int] = io.Source.stdin.getLines.map(_.toInt).toList

  def fact(n: BigInt): BigInt = {
    def loop(i: BigInt, acc: BigInt): BigInt = {
      if (i <= 1) acc
      else loop(i - 1, acc * i)
    }

    loop(n, 1)
  }

  def countZeros(n: BigInt): Int = {
    n.toString.reverse.takeWhile(_ == '0').length
  }

  (for (num <- src) yield { countZeros(fact(num)) }).init.foreach(println)
}