import scala.io.StdIn.readInt

object Main {
  def pow(x:Long, y:Long):Long = {
    def pow2(m:Long, n:Long, odd:Long, b:Long):Long = {
      n match {
        case 0 => 1
        case 1 => m*odd
        case _ =>
          pow2(m*m, n/2, (if(n%2==1) odd*b else odd), b*b)
      }
    }
    pow2(x, y, 1, x)
  }

  def getZeros(n:Long,ct:Long,i:Long):Long = {
    val d = n/pow(5,i)
    if(d>0) getZeros(n,d+ct,i+1) else ct
  }

  def main(args:Array[String]) = {
    var n = 0;
    while( {n=readInt;n}!= 0 )
      println(getZeros(n,0,1))
  }
}