Under construction

Still being built. Things may change

Number of zeros

Interview

Time limit1sMemory limit1024 MB

Summary
Given N and K, compute the binomial coefficient C(N,K) and count how many zero digits appear in its decimal representation.
Level

Medium6 of 10

Topics
Math, Combinatorics, Implementation, Number theory
Solved
No attempts yet

Problem

Two integers NN and KK are given. Write a program zeros that finds the number of zeros in the decimal representation of C_NKC\_N^K.

C_NKC\_N^K is the number of different ways to choose KK items from NN distinct items, ignoring their order.

C_NK=N!K!(N−K)!C\_N^K = \frac{N!}{K!(N-K)!}

Input

The first line of the standard input contains two integers NN and KK.

Output

The first line of the standard output must contain a single integer, the number of zeros.

Constraints

  • 1≤N≤10001 ≤ N ≤ 1000
  • 0≤K≤N0 ≤ K ≤ N

Hint

The number 50!40!(50−40)!=10272278170\frac{50!}{40!(50-40)!} = 10272278170 contains two zeros.

Examples1

  1. Example 1

    Input
    50 40
    
    Expected output
    2