#include <bits/stdc++.h>
using namespace std;
int a[100000];
int main() {
  int n, x, k, i;
  scanf("%d%d%d", &n, &x, &k);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int n1 = 0, n2 = 0;
  long long ans = 0;
  for (i = 0; i < n; i++) {
    int low = (a[i] - 1) / x;
    while (n1 < n && a[n1] < a[i]) n1++;
    while (n1 < n) {
      if (a[n1] / x - low >= k) break;
      n1++;
    }
    while (n2 < n && a[n2] < a[i]) n2++;
    while (n2 < n) {
      if (a[n2] / x - low >= k + 1) break;
      n2++;
    }
    if (a[n1] / x - low == k) ans += (n2 - n1);
  }
  printf("%lld\n", ans);
  return 0;
}
