Contests | Virtual Contests | Problems | Submit | Runs Status | Rank List | Forum |

Time Limit: 1.0 Seconds Memory Limit: 65536K

Total Runs: 1926 Accepted Runs: 444 Multiple test files

Farmer John has begun branding the cows with sequential prime
numbers. Bessie has noticed this and is curious about the occurrence
of various digits in those brands. ### Input

* Line 1: Three space-separated integers: *A*, *B*, and *D*
### Output

* Line 1: The count of primes in the range that contain the digit *D*.
### Sample Input

### Sample Output

### Input Details

How many primes in the range 10..15 contain the digit 3? ### Output Details

Just 13 in this range contains a '3'.

Help Bessie determine the number of primes in the inclusive range
*A*..*B* (1 ≤ *A* ≤ *B* ≤ 4,000,000; *B* ≤ *A* + 1,000,000; one test case
has *B* ≤ *A* + 2,000,000 ) that contain a supplied digit *D*.

A prime is a positive integer with exactly two divisors (1 and itself). The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and, 29.

10 15 3

1

Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz