#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
void solve() {
  long long n, x, k;
  cin >> n >> x >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long y = x * ((a[i] + x - 1) / x);
    long long z = y;
    if (k == 0)
      y--;
    else
      y += (k - 1) * x + (x - 1);
    z = max(a[i], y - x + 1);
    ans += max((long long)0, upper_bound(a, a + n, y) - a - (long long)1 -
                                 (lower_bound(a, a + n, max(a[i], z)) - a) +
                                 (long long)1);
  }
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
}
