#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e6 + 5;
long long n, x, k;
long long a[maxn];
int main() {
  scanf("%lld%lld%lld", &n, &x, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long l = a[i] % x == 0 ? a[i] : (a[i] / x + 1) * x;
    ans += lower_bound(a + 1, a + 1 + n, l + k * x) -
           lower_bound(a + 1, a + 1 + n, max(a[i], l + (k - 1) * x));
  }
  printf("%lld\n", ans);
}
