#include <bits/stdc++.h>
using namespace std;
long long a[100000 + 10];
int main() {
  long long n, x, k;
  scanf("%lld%lld%lld", &n, &x, &k);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  sort(a, a + n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long t, l, r;
    if (a[i] % x == 0) {
      t = a[i] / x;
      l = (t + k - 1) * x;
      r = (t + k) * x;
    } else {
      t = a[i] / x + 1;
      l = (t + k - 1) * x;
      r = (t + k) * x;
    }
    if (k == 0) {
      l = a[i];
      r = t * x;
    }
    long long tt = lower_bound(a, a + n, r) - lower_bound(a, a + n, l);
    ans += tt;
  }
  printf("%lld", ans);
  return 0;
}
