Smallest Prime Factor

Time limit1sMemory limit128 MB

Problem

List the positive integers whose smallest prime factor is P in increasing order. Find the N-th number in this list.

Input

The first line contains two integers N and P. (1 ≤ N, P ≤ 10^9) P is always prime.

Output

Print the N-th smallest positive integer whose smallest prime factor is P. If that number is greater than 10^9, print 0.