#include <bits/stdc++.h>
using namespace std;
const int B = 27397, MOD = 1e9 + 7;
const int B1 = 33941, MOD1 = 1e9 + 9;
const int MAXN = 1e5 + 10;
int n, x, k;
long long a[MAXN];
int solve(int lo) {
  long long hi_lo = lo;
  long long hi_hi;
  if (k == 0) {
    if (lo % x == 0) return 0;
    hi_hi = (lo - (lo % x)) + x - 1;
  } else {
    if (lo % x != 0) hi_lo = (lo - (lo % x)) + x;
    hi_lo += (long long)(k - 1) * x;
    hi_hi = hi_lo + x - 1;
  }
  return (upper_bound(a, a + n, hi_hi) - a) -
         (lower_bound(a, a + n, hi_lo) - a);
}
int main(void) {
  scanf("%d%d%d", &n, &x, &k);
  for (int i = 0; i < n; ++i) scanf("%lld", &a[i]);
  sort(a, a + n);
  long long sol = 0;
  for (int i = 0; i < n; ++i) {
    sol += (long long)solve(a[i]);
  }
  printf("%lld\n", sol);
  return 0;
}
