#include <bits/stdc++.h>
using namespace std;
long long n, x, k, a[1000005], cnt;
long long countN(long long i, long long j) {
  auto cj = upper_bound(a, a + n, j);
  auto ci = lower_bound(a, a + n, i);
  return (cj - ci);
}
int main() {
  ios_base::sync_with_stdio(0);
  ;
  cin >> n >> x >> k;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long c;
  long long l, r, A;
  for (int i = 0; i < n; ++i) {
    c = (a[i] - 1) / x;
    l = x * (c + k);
    r = l + x - 1;
    if (l < a[i]) l = a[i];
    if (r >= a[i])
      A = countN(l, r);
    else
      A = 0;
    cnt += A;
  }
  cout << cnt;
}
