Codeforces Beta Round 72 (Div. 1 Only)
D
Numbers
Codeforces
2400
原题
← CE →
翻译中…

One quite ordinary day Valera went to school (there's nowhere else he should go on a week day). In a maths lesson his favorite teacher Ms. Evans told students about divisors. Despite the fact that Valera loved math, he didn't find this particular topic interesting. Even more, it seemed so boring that he fell asleep in the middle of a lesson. And only a loud ringing of a school bell could interrupt his sweet dream.

翻译中…

Of course, the valuable material and the teacher's explanations were lost. However, Valera will one way or another have to do the homework. As he does not know the new material absolutely, he cannot do the job himself. That's why he asked you to help. You're his best friend after all, you just cannot refuse to help.

翻译中…

Valera's home task has only one problem, which, though formulated in a very simple way, has not a trivial solution. Its statement looks as follows: if we consider all positive integers in the interval $[*a*;*b*]$ then it is required to count the amount of such numbers in this interval that their smallest divisor will be a certain integer $*k*$ (you do not have to consider divisor equal to one). In other words, you should count the amount of such numbers from the interval $[*a*;*b*]$, that are not divisible by any number between $2$ and $*k* - 1$ and yet are divisible by $*k*$.

翻译中…

Input

翻译中…

The first and only line contains three positive integers $*a*$, $*b*$, $*k*$ ($1 ≤ *a* ≤ *b* ≤ 2·10^{9}, 2 ≤ *k* ≤ 2·10^{9}$).

翻译中…

Output

翻译中…

Print on a single line the answer to the given problem.

翻译中…

Note

翻译中…

Comments to the samples from the statement:

翻译中…

In the first sample the answer is numbers $2, 4, 6, 8, 10$.

翻译中…

In the second one — $15, 21$

翻译中…

In the third one there are no such numbers.

翻译中…

样例

Input #1
1 10 2
Output #1
5
InputCopy OutputCopy
Input #2
12 23 3
Output #2
2
InputCopy OutputCopy
Input #3
6 19 5
Output #3
0
InputCopy OutputCopy
题目信息
题号
83D
时间限制
3 s
内存限制
256 MB
标签
动态规划
数学
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。