#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int a[100005];
int bi_sea(long long q, int n) {
  if (q > a[n - 1]) return n;
  int l = 0, r = n - 1;
  while (l < r) {
    int mid = (l + r) / 2;
    if (a[mid] >= q) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  return l;
}
int main() {
  std::ios::sync_with_stdio(false);
  long long x, k;
  int n;
  cin >> n >> x >> k;
  int i;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long sum = 0;
  for (i = 0; i < n; i++) {
    int p = ceil(1.0 * a[i] / x);
    long long f = (p + k - 1);
    f = f * x;
    long long w = f + x;
    if (f < a[i]) f = a[i];
    int e = bi_sea(f, n), r = bi_sea(w, n);
    sum += r - e;
  }
  cout << sum << endl;
  return 0;
}
