import java.util.Scanner
object Main extends App {
  val in = new Scanner(System.in)
  val n = in.nextLong
  val Max = Math.pow(10, 18).toLong
  val divs: Stream[Long] = 10 #:: divs.map(_ * 5).takeWhile(_ <= Max)
  println(divs.map(n / _).sum)
}