eolymp
bolt
Try our new interface for solving problems
Problems

Two measurements

Two measurements

Scientists plan to conduct an important experiment using the research module on planet X-2019. During the experiment, two measurements will be carried out: main and control. Each measurement takes exactly one hour and must begin an integer number of hours after the start of the research module.

The experiment data is planned to be immediately transmitted to the orbital station. The communication channel with the orbital station will be installed from l-th to r-th hour from the start of the research module, inclusive. In addition, according to the plan of the experiment between measurements, the planet must perform an integer number of revolutions around its axis. Planet X-2019 rotates around its axis in a hours.

Thus, if measurements are carried out at i-th and j-th hour, then the inequality li < jr should be satisfied, and the value (j - i) must be a multiple of a. Now scientists need to understand how many different ways there are to measure.

Write a program that according to the specified time limits of measurements l and r and the period of planet rotation around its axis a determines the number of possible measurements to be taken: find the number of pairs of integers i and j such that li < jr, and the value (j - i) is a multiple of a.

Input

Three integers, one in a line: l, r и a (1l < r109, 1a109).

Output

Print a single integer: the number of ways to measure.

Explanation

In the first example, you can measure in the next couple of hours: (1, 3), (1, 5), (2, 4), (3, 5).

In the second example, the duration of the communication channel is not enough to make two measurements.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1
5
2
Output example #1
4
Input example #2
4
9
6
Output example #2
0
Source 2018 All Russia school informatics olympiad, Regional stage, Day 1, Moscow, January 26, 2019, Problem А