eolymp
bolt
Try our new interface for solving problems
Problems

GCD and LCM

GCD and LCM

Given two positive integers A and B. Find the number of pairs of numbers (P, Q), which for them is A - GCD(P, Q), and B - LCM(P, Q).

Input

In a single line two positive integers A and B (A < 105, B ≤ 106).

Output

Single number - the required number of pairs.

Time limit 1 second
Memory limit 64 MiB
Input example #1
3 60
Output example #1
4