#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long n, m, l = 0, p = 0, i, flag = 0, k, j, r = 0, q = 0, t, curr = 0, d,                     x;     cin >> n >> x >> k;     long long a[n];     for (long long i = 0; i < n; i++) {       cin >> a[i];     }     sort(a, a + n);     for (long long i = 0; i < n; i++) {       long long r1 = a[i] + (x * k);       if (a[i] % x == 0) {         r1--;       }       r1 -= r1 % x;       long long r2 = r1 + x - 1;       r1 = max(a[i], r1);       auto it = upper_bound(a, a + n, r2);       auto it1 = lower_bound(a, a + n, r1);       p += it - it1;     }     cout << p;     return 0;   }   