This page is still under construction.

Parts of this page are still being built. What you see may change.

Zeros

Time limit1sMemory limit512 MB

Summary
Find the number of trailing zeros of the least common multiple of all integers from a to b, where a and b can reach 10^18.
Level

Medium7 of 10

Topics
Number theory, Math, Binary search, Implementation
Solved
No attempts yet

Problem

Santa Claus is already preparing for Christmas 2021. He wants to buy some positive number of presents, such that he will be able to divide them evenly (without remainder) among all eligible (not naughty) children. However, he does not yet know how many eligible children there will be; he only knows that this number will be between aa and bb. Therefore, he wants to buy the minimum positive number of presents that can be divided evenly between any number xx of children with x∈{a,a+1,…,b}x \in \{a, a+1, \dots, b\}.

He has computed this (possibly huge) number of presents, but he is unsure about the correctness, and he would like your help in performing the following basic sanity check. Are you able to tell him how many zero digits there should be at the end of this number?

Input

The first and only line of the input consists of two space-separated integers aa and bb (1≤a≤b≤10181 \le a \le b \le 10^{18}).

Output

Output a single integer -- the number of zeros at the end of the number of presents that Santa needs to buy.

Hint

First example: If there can be between 1 and 6 children, then Santa needs at least 60 presents (as this is the smallest number that is divisible by all of 1, 2, 3, 4, 5 and 6), and the number 60 has a single zero at the end.

Second example: If there can be either 10 or 11 children, Santa will buy 110 presents.

Examples2

  1. Example 1

    Input
    1 6
    
    Expected output
    1
    
  2. Example 2

    Input
    10 11
    
    Expected output
    1