SOLVE
LATER
It is well-known that the equation: \(x^k + y^k = z^k\) has no positive solution for \(k \ge 3\). But what if we consider solution over a finite field. Now, the task you are given is related to that:
Given a prime \(P\), you are asked to count the number of positive integers \(k\) doesn't exceed \(L\) s.t. modulo equation \(x^k + y^k = z^k\ (modulo\ P)\) has solution \(0 < x, y, z < P\).
Input Format
A line contains two space-separated integers \(P, L\) as described above.
Output Format
Output answer in a single line.
Constraints
Let's enumerate all possible values of \(k\):
So, answer is \(2\).