#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
long long a[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, x, k, cnt;
  cin >> n >> x >> k;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  cnt = 0;
  for (long long i = 0; i < n; ++i) {
    long long l = max(((a[i] - 1) / x + k) * x, a[i]);
    long long r = ((a[i] - 1) / x + k + 1) * x;
    cnt += lower_bound(a, a + n, r) - lower_bound(a, a + n, l);
  }
  cout << cnt << endl;
  return 0;
}
