Vasili continues to create sequences. Today at school, he learned about the exponentiation operation, and decided to invent a new sequence.
First, he writes a natural number on the board. Each next number he writes will be equal to raised to the power of the previous number. In other words, the sequence is defined as follows:
Then, Vasili wants to find the element of this sequence with the smallest index that is divisible by a given number . Since the numbers in the sequence can get very large, he needs your help.
Two natural numbers , (1 \leq A \leq 10^9, 1 \leq N \leq 10^9) are given.
If no element in the sequence is divisible by , output . Otherwise, output the smallest index of the first element divisible by .
Example 1