#include <bits/stdc++.h>   using namespace std;   int a[100005];   int main(void) {     int n, x, k;     scanf( %d %d %d , &n, &x, &k);     for (int i = 0; i < n; i++) {       scanf( %d , a + i);     }     sort(a, a + n);     long long sum = 0;     for (int i = 0; i < n; i++) {       long long p = (long long)ceil(a[i] * 1.0 / x) * x;       sum +=           lower_bound(a, a + n, p + (long long)k * x) -           lower_bound(a, a + n, max((long long)a[i], p + (long long)(k - 1) * x));     }     cout << sum << endl;     return 0;   }   