#include <bits/stdc++.h>
using namespace std;
int n, a[100001];
int cb(long long x, long long y) {
  int st, dr, mij;
  int ind;
  st = 1;
  dr = n;
  while (st <= dr) {
    mij = (st + dr) >> 1;
    if (x <= a[mij])
      dr = mij - 1;
    else
      st = mij + 1;
  }
  ind = st;
  st = 1;
  dr = n;
  while (st <= dr) {
    mij = (st + dr) >> 1;
    if (y >= a[mij])
      st = mij + 1;
    else
      dr = mij - 1;
  }
  return max(dr - ind + 1, 0);
}
int main() {
  int k, x, i;
  long long capst, rasp = 0;
  cin >> n >> x >> k;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  if (k == 0) {
    for (i = 1; i <= n; i++) {
      if (a[i] % x == 0) continue;
      rasp = rasp + cb(a[i], (a[i] / x + 1) * x - 1);
    }
  } else {
    for (i = 1; i <= n; i++) {
      capst = 1ll * (a[i] / x + (a[i] % x != 0)) * x + 1ll * (k - 1) * x;
      rasp = rasp + cb(capst, capst + x - 1);
    }
  }
  cout << rasp;
  return 0;
}
