B-Smooth Numbers

No attempts yetTime limit1sMemory limit128 MB

Problem

Let BB be a positive integer. A positive integer xx is called a BB-smooth number if none of its prime factors is greater than BB. Equivalently, xx is BB-smooth when it can be written as a product of positive integers that are each at most BB. (In particular, 11 is BB-smooth for every BB.)

Given three positive integers nn, mm and BB, count how many BB-smooth numbers lie in the closed interval [n, n+m][n,\ n+m].

Input

A single line contains three integers nn, mm and BB, separated by single spaces, where 1n20000000001 \le n \le 2\,000\,000\,000, 1m1000000001 \le m \le 100\,000\,000 and 1B10000001 \le B \le 1\,000\,000.

Output

Print a single integer: the number of BB-smooth numbers in the interval [n, n+m][n,\ n+m].