Define $P(x)$ as the number of integers $y$ such that $1 < y < x$ and $y^3 \equiv 1 \pmod x$.
Find how many positive integers $x \le n$ satisfy $P(x) = m$.
Input
A single line containing two integers $n$ and $m$.
Output
Output a single integer representing the answer.
Examples
Input 1
10 0
Output 1
8
Input 2
100000000 242
Output 2
24038
Subtasks
For $100\%$ of the data, $1 < n \le 2 \times 10^{10}$ and $0 \le m < n$.
| Test Case ID | $n$ | $m$ |
|---|---|---|
| $1$ | $\le 2\times 10^{10}$ | $=666$ |
| $2$ | $\le 10^3$ | |
| $3$ | ||
| $4$ | ||
| $5$ | ||
| $6$ | ||
| $7$ | ||
| $8$ | $\le 10^8$ | $\ge 300$ |
| $9$ | ||
| $10$ | ||
| $11$ | $\le 5\times 10^9$ | $\ge 200$ |
| $12$ | ||
| $13$ | $=0$ | |
| $14$ | $\le 2\times 10^{10}$ | |
| $15$ | $\le 10^8$ | |
| $16$ | ||
| $17$ | ||
| $18$ | ||
| $19$ | ||
| $20$ | $\le 2\times 10^{10}$ |