#abc300g. [abc300_g]P-smooth number
[abc300_g]P-smooth number
Problem Statement
A positive integer is called a -smooth number if none of its prime factors exceeds .
Given an integer and a prime not exceeding , find the number of -smooth numbers not exceeding .
Constraints
- is an integer such that .
- is a prime such that .
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1
36 3
Sample Output 1
14
The -smooth numbers not exceeding are the following integers: .
Note that is a -smooth number for all primes .
Sample Input 2
10000000000000000 97
Sample Output 2
2345134674