#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int a[maxn];
int main() {
  int c, x, k;
  cin >> c >> x >> k;
  for (int i = 0; i < c; i++) cin >> a[i];
  sort(a, a + c);
  long long ans = 0;
  for (int i = 0; i < c; i++) {
    long long mlm = a[i] / x + (a[i] % x != 0);
    long long l = (mlm + k - 1) * x;
    long long r = l + x;
    if (k == 0) {
      l = a[i];
      r = mlm * x;
    }
    ans += lower_bound(a, a + c, r) - lower_bound(a, a + c, l);
  }
  cout << ans << endl;
  return 0;
}
