The Last Digit#4756

The Last Digit

1 second
64 megabytes
Easy

Given a number in the decimal numeral system, determine how many numeral systems exist in which the number ends with the digit .

Input

The input consists of the number (0 \le N \le 10^6) and the digit (0 \le k \le 9).

Output

Output a single integer representing the number of numeral systems where the number ends with the digit . If there are infinitely many such numeral systems, output "".

Examples

Example 1

Loading
Loading