The package for this problem was not updated by the problem writer or Codeforces administration after we've upgraded the judging servers. To adjust the time limit constraint, a solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then the value 800 ms will be displayed and used to determine the verdict.

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
D. Numbers

time limit per test

3 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputOne 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.

Examples

Input

1 10 2

Output

5

Input

12 23 3

Output

2

Input

6 19 5

Output

0

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.

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/25/2022 23:50:42 (g2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|