Combination#7439

Combination

1 second
128 megabytes
Medium

How many numbers are divisible by the prime number in the first rows of Pascal Triangle? In other words, find the number of pairs (, ) (0 \le j \le i < n) so that C(i, j) is divisible by . Here

prb7439.gif
prb7439.gif

Input

The first line contains two integer numbers , (1 \le n \le 10^7, 3 \le p \le 100).

Output

Print the answer.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading