While Vasya finished eating his piece of pizza, the lesson has already started. For being late for the lesson, the teacher suggested Vasya to solve one interesting problem. Vasya has an array *a* and integer *x*. He should find the number of different ordered pairs of indexes (*i*, *j*) such that *a*<sub class="lower-index">*i*</sub> ≤ *a*<sub class="lower-index">*j*</sub> and there are exactly *k* integers *y* such that *a*<sub class="lower-index">*i*</sub> ≤ *y* ≤ *a*<sub class="lower-index">*j*</sub> and *y* is divisible by *x*.

In this problem it is meant that pair (*i*, *j*) is equal to (*j*, *i*) only if *i* is equal to *j*. For example pair (1, 2) is not the same as (2, 1).
The first line contains 3 integers *n*, *x*, *k* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>, 1 ≤ *x* ≤ 10<sup class="upper-index">9</sup>, 0 ≤ *k* ≤ 10<sup class="upper-index">9</sup>), where *n* is the size of the array *a* and *x* and *k* are numbers from the statement.

The second line contains *n* integers *a*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — the elements of the array *a*.
In first sample there are only three suitable pairs of indexes — (1, 2), (2, 3), (3, 4).

In second sample there are four suitable pairs of indexes(1, 1), (2, 2), (3, 3), (4, 4).

In third sample every pair (*i*, *j*) is suitable, so the answer is 5 * 5 = 25.
4 2 1
1 3 5 7
3
4 2 0
5 3 1 7
4
5 3 1
3 3 3 3 3
25
5 3 4
24 13 1 24 24
4
4 2 2
1 3 5 7
2
5 1 0
10 12 14 20 30
0
7 3 1
3 3 6 9 12 15 18
9
2 5 0
3 4
3
3 5 0
4 4 4
9
3 6 0
3 4 5
6
10 2 1
2 2 2 2 2 2 2 1 2 1
80
100 2 1
1 2 2 2 1 2 1 2 2 2 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 2 1 1 2 1 2 2 2 2 2 1 1 1 2 1 2 1 2 1 2 1 2 2 1 2 2 2 1 1 1 2 2 1 1 2 2 1 1 1 1 1 1 2 2 1 1 2 2 1 2 2 1 2 1 2 2 1 2 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 2 1
5200
1 13 1
13
1
2 1 1000000000
1 1000000000
1
2 1000000000 1
1 1000000000
2
1 1 1
1
1
5 1000000000 1
1000000000 1 1 1 1
5
2 1000 1000000
1 1000000000
1
6 2 10
1 1 1 20 20 20
9
1 1000000000 1
1000000000
1
4 65536 65536
1 2 3 4
0
1 600000000 1
500000000
0
5 3 2
2 3 4 5 8
2
n, x, k = map(int, input().split())
arr = list(map(int, input().split()))

# import random
# n, x, k = 10 ** 5, 4, 9
# arr = [random.randint(10, 1000) for _ in range(10 ** 5)]

arr.sort()

res = 0
mid_l = None
mid_r = None
prev_success = False
for i in range(n):
    if i != 0 and arr[i] == arr[i-1] and prev_success:
        res += mid_r - mid_l + 1
        continue
    e = arr[i]
    if k != 0:
        if e % x == 0:
            e1 = e
        else:
            e1 = ((e // x) + 1) * x
        range_left = e1 + x * (k - 1)
        range_right = e1 + x * (k - 1) + (x - 1)
    else:
        if e % x == 0:
            prev_success = False
            continue
        range_left = e
        range_right = ((e // x) + 1) * x - 1

    if arr[-1] < range_left:
        prev_success = False
        continue

    l = 0
    r = n - 1
    while True:
        if arr[l] >= range_left:
            mid = l
            break
        if l == r:
            mid = l
            break
        if l == r - 1:
            if arr[l] < range_left:
                mid = r
            else:
                mid = l
            break
        mid = (r + l) // 2
        if arr[mid] < range_left:
            l = mid
        elif arr[mid] >= range_left:
            r = mid
    mid_l = mid

    if arr[i] > range_right:
        prev_success = False
        continue

    l = 0
    r = n - 1
    while True:
        if arr[r] <= range_right:
            mid = r
            break
        if l == r:
            mid = r
            break
        if l == r - 1:
            if arr[r] > range_right:
                mid = l
            else:
                mid = r
            break
        mid = (r + l) // 2
        if arr[mid] <= range_right:
            l = mid
        elif arr[mid] > range_right:
            r = mid
    mid_r = mid
    res += mid_r - mid_l + 1
    prev_success = True
print(res)