#MTHA0000003. Đếm bội trong một đoạn (Count Multiples in an Interval)

Đếm bội trong một đoạn (Count Multiples in an Interval)

Count Multiples in an Interval

Version: Phuoc Hung OJ Extended

Problem Statement

Given positive integers L,R,KL,R,K with L≤RL\le R, count the integers in [L,R][L,R] that are divisible by KK.

Input

One line contains three positive integers LL, RR, and KK.

Output

Print the number of integers XX satisfying L≤X≤RL\le X\le R and K∣XK\mid X.

Subtasks

  • Subtask 1 (30 points):
    • 1≤L≤R≤1061 \le L \le R \le 10^6.
    • 1≤K≤10181 \le K \le 10^{18}.
  • Subtask 2 (70 points):
    • 1≤L≤R≤10181 \le L \le R \le 10^{18}.
    • 1≤K≤10181 \le K \le 10^{18}.

Examples

Example 1

Input

5 20 4

Output

4

Explanation

The multiples in the interval are 8,12,16,208,12,16,20, so the answer is 44.

Example 2

Input

1 10 20

Output

0

Explanation

The smallest positive multiple of 2020 is 20>1020>10, so the answer is 00.

Example 3

Input

1000000000000 1000000000100 25

Output

5

Explanation

The multiples are 101210^{12}, 1012+2510^{12}+25, 1012+5010^{12}+50, 1012+7510^{12}+75, and 1012+10010^{12}+100, for a total of 55.