Factorial n is written as n! and n! = 1∗2∗3∗. . .∗(n−1)∗n. For example 2! = 1∗2 = 2, 3! = 1∗2∗3 = 6, 5! = 120, 10! = 3, 628, 800, etc. The function f zero(n) denotes the number of trailing zeroes in n! in decimal number system. For example f zero(2) = 0, f zero(5) = 1, f zero(10) = 2. Given the domain of the input parameter v of f zero(v) function, you will have to find out how many different values of f zero() are there within this range.
The input file contains at most 50001 lines of inputs. Each line contains two positive integers low and high (0 < low ≤ high ≤ 9 ∗ 1018). Input is terminated by a line containing two zeroes.
For each line of input produce one line of output. This line contains an integer D, which denotes how many different values the function f zero(v) can have if (low ≤ v ≤ high). Note: Illustration for Sample input 1: as 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, 7! = 5,040, 8! = 40,320, 9! = 362,880, 10! = 3,628,800, so f zero(1) = 0, f zero(2) = 0, f zero(3) = 0, f zero(4) = 0, f zero(5) = 1, f zero(6) = 1, f zero(7) = 1, f zero(8) = 1, f zero(9) = 1 and f zero(10) = 2. So in this range (1 to 10) there are three different values of f zero(v): 0, 1 and 2.
範例輸入 1
1 10 1 3 0 0
範例輸出 1
3 1
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.