#include <bits/stdc++.h>
using namespace std;
long long modexp(long long x, long long y, long long m) {
  long long ans = 1;
  ans %= m;
  while (y > 0) {
    if (y % 2 == 1) ans = (ans * x) % m;
    y /= 2;
    x = (x * x) % m;
  }
  return ans;
}
long long getmid(long long l, long long r) { return l + (r - l) / 2; }
long long factorial(long long x) {
  long long prod = 1, i = 1;
  while (i <= x) {
    prod *= i;
  }
  return prod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, x, k, i, l, r;
  cin >> n >> x >> k;
  vector<long long> a(n);
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  long long ans = 0;
  if (k == 0) {
    for (i = 0; i < n; i++) {
      if (a[i] % x == 0) continue;
      l = a[i] / x + 1;
      auto it = lower_bound(a.begin(), a.end(), x * l);
      auto it2 = lower_bound(a.begin(), a.end(), a[i]);
      ans += (it - it2);
    }
    cout << ans << "\n";
    return 0;
  }
  for (i = 0; i < n; i++) {
    if (a[i] % x == 0)
      l = a[i] / x;
    else
      l = (a[i] / x + 1);
    r = x * (l + k - 1);
    auto it = lower_bound(a.begin(), a.end(), r + x);
    auto it2 = lower_bound(a.begin(), a.end(), r);
    if (it - it2 > 0) ans += it - it2;
  }
  cout << ans << "\n";
  return 0;
}
