Gats and the Twin Milk Locks
Time limit: 2000 msMemory limit: 256 MB
Gats finds ancient milk chambers labeled . Every chamber has two number locks, and all chambers share a fixed offset .
At the chamber labeled :
- the first lock shows ;
- the second lock shows .
A chamber is stable if the product of its two lock values is exactly :
Count the stable chamber labels satisfying .
Input
The first and only line contains two integers and satisfying .
Output
Print one integer: the number of stable chamber labels.
Samples
Sample 1
Input
10 1
Output
4
The stable chamber labels are , , , and . Their pairs of lock values are , , , and , respectively.