//DFSテンプレート
fun main(args: Array<String>) {
    val N = nextLong()
    tailrec fun g1(n: Long, p: Long): Long {
        if (n == 0L) return 0
        return (n / p) + g1(n / p, p)
    }
    tailrec fun g2(n: Long, p: Long): Long {
        if (n % 2 == 1L) {
            return g1(n, p) - g2(n - 1, p)
        }
        var res = g1(n / 2, p)
        if (p == 2L) res += n / 2
        return res
    }
    val ans =  Math.min(g2(N,2), g2(N,5))
    println(ans)
}
fun next() = readLine()!!
fun nextLong() = next().toLong()