#include <bits/stdc++.h>
using namespace std;
long long n, x, k;
long long a[100100];
long long ans;
long long solve(long long le, long long ri) {
  if (le > a[n - 1] || ri < a[0]) return 0;
  long long res = 0;
  int l = 0;
  int r = n - 1;
  int m;
  while (r - l > 1) {
    m = (l + r) / 2;
    if (a[m] >= le)
      r = m;
    else
      l = m;
  }
  if (a[l] >= le)
    m = l;
  else
    m = r;
  res = m;
  l = 0;
  r = n - 1;
  while (r - l > 1) {
    m = (l + r) / 2;
    if (a[m] <= ri)
      l = m;
    else
      r = m;
  }
  if (a[r] <= ri)
    m = r;
  else
    m = l;
  return m - res + 1;
}
int main() {
  cin >> n >> x >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    long long y = a[i] - 1;
    y /= x;
    long long le = max(x * (k + y), a[i]);
    long long ri = x * (k + y + 1) - 1;
    ans += solve(le, ri);
  }
  cout << ans << endl;
}
