#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18 + 1;
map<long long int, long long int> cc;
long long int arr[111111];
long long int pp = 0;
int main(void) {
  long long int n, x, k;
  cin >> n >> x >> k;
  for (int e = 0; e < n; e++) cin >> arr[e];
  sort(arr, arr + n);
  arr[n] = INF;
  for (long long int e = 0; e < n; e++) {
    long long int st;
    if (cc[arr[e]]) {
      pp += cc[arr[e]];
      continue;
    }
    if (arr[e] % x == 0) {
      st = arr[e];
    } else {
      st = ((arr[e] / x) + 1) * x;
    }
    st += (k - 1) * x;
    long long int l = e, r = n, mid, ppp = (1e9 + 7);
    while (l <= r) {
      mid = (l + r) / 2;
      if (arr[mid] >= st) {
        ppp = min(ppp, mid);
        r = mid - 1;
      }
      if (arr[mid] < st) {
        l = mid + 1;
      }
    }
    long long int kk = 0;
    if (arr[ppp] >= st && arr[ppp] < st + x) {
      kk++;
    }
    l = e, r = n, mid;
    long long int ppr = (1e9 + 7);
    while (l <= r) {
      mid = (l + r) / 2;
      if (arr[mid] >= st + x) {
        ppr = min(ppr, mid);
        r = mid - 1;
      }
      if (arr[mid] < st + x) {
        l = mid + 1;
      }
    }
    kk += ppr - ppp - 1;
    if (kk < 0) kk = 0;
    pp += kk;
    cc[arr[e]] = kk;
  }
  cout << pp;
  return 0;
}
