#include <bits/stdc++.h>
using namespace std;
int bs1(long long a[], long long val, int l1, int r1) {
  int l = l1, r = r1;
  int mid;
  if (a[r] < val) {
    return r + 1;
  }
  if (a[l] >= val) {
    return l;
  }
  while (r - l > 1) {
    mid = l + (r - l) / 2;
    if (a[mid] >= val) {
      r = mid;
    } else {
      l = mid;
    }
  }
  if (a[l] >= val) {
    return l;
  } else if (a[r] >= val) {
    return r;
  }
}
int bs2(long long a[], long long val, int l1, int r1) {
  int l = l1, r = r1;
  int mid;
  if (a[r] < val) {
    return r;
  }
  if (a[l] >= val) {
    return l - 1;
  }
  while (r - l > 1) {
    mid = l + (r - l) / 2;
    if (a[mid] >= val) {
      r = mid;
    } else {
      l = mid;
    }
  }
  if (a[r] < val) {
    return r;
  } else if (a[l] < val) {
    return l;
  }
}
int main() {
  long long n, x, k;
  cin >> n >> x >> k;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long ans = 0;
  int last = -1;
  for (int i = 0; i < n; i++) {
    int min;
    if (last == -1) {
      last = i;
      min = i;
    } else if (last != -1) {
      if (a[last] != a[i]) {
        min = i;
        last = i;
      } else {
        min = last;
      }
    }
    long long xx = (a[i] / x) * x;
    if (a[i] % x != 0) {
      xx += x;
    }
    int x1 = bs1(a, xx + (k - 1) * x, min, n - 1);
    int x2 = bs2(a, xx + k * x, min, n - 1);
    ans += (x2 - x1 + 1);
  }
  cout << ans << endl;
  return 0;
}
