#include <bits/stdc++.h>
using namespace std;
long long a[100010];
int main() {
  long long n, k, x;
  cin >> n >> x >> k;
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  sort(a, a + n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    long long p = (a[i] - 1) / x + 1;
    sum += (lower_bound(a, a + n, p * x + k * x) -
            lower_bound(a, a + n, max(a[i], p * x + (k - 1) * x)));
  }
  cout << sum << endl;
  return 0;
}
