#include <bits/stdc++.h>
using namespace std;
long long A[100001], n;
int bs1(int st, int dr, long long val) {
  int mij = st + (dr - st) / 2;
  if (st >= dr) {
    if (A[mij] < val) mij++;
    return mij;
  }
  if (A[mij] < val) {
    return bs1(mij + 1, dr, val);
  } else {
    return bs1(st, mij, val);
  }
}
long long x, k, st, dr, i, val1, val2, rez;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> x >> k;
  rez = 0LL;
  for (i = 1; i <= n; i++) cin >> A[i];
  sort(A + 1, A + n + 1);
  for (i = 1; i <= n; i++) {
    val1 = x * (k + (A[i] - 1) / x);
    val2 = val1 + x;
    val1 = max(val1, A[i]);
    if (val1 <= val2) {
      st = bs1(1, n, val1);
      dr = bs1(1, n, val2);
      rez = rez + dr - st;
    }
  }
  cout << rez << "\n";
  return 0;
}
