#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x, k, ara[100000 + 100];
  scanf("%lld %lld %lld", &n, &x, &k);
  for (int i = 0; i < n; i++) scanf("%lld", &ara[i]);
  sort(ara, ara + n);
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    long long int bad = (ara[i] - 1) / x;
    long long int khuja = x * (k + bad);
    long long int khujb = x * (k + bad + 1);
    ans += (lower_bound(ara, ara + n, khujb) -
            lower_bound(ara, ara + n, max(khuja, ara[i])));
  }
  cout << ans << endl;
}
