#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
long long a[maxn];
unordered_map<long long, long long> cnt;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  int n;
  cin >> n;
  long long x, k;
  cin >> x >> k;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    if (cnt[a[i]] != 0) {
      ans += cnt[a[i]];
      continue;
    }
    long long L = 0, R = 1e9 + 10;
    while (L + 1 < R) {
      long long M = (L + R) / 2LL;
      if (M * x >= a[i])
        R = M;
      else
        L = M;
    }
    long long l = R, r = R + k - 1;
    L = i - 1, R = n;
    while (L + 1 < R) {
      long long M = (L + R) / 2LL;
      if (a[M] >= r * x)
        R = M;
      else
        L = M;
    }
    if (R == n) continue;
    int index = R;
    L = R, R = n;
    while (L + 1 < R) {
      long long M = (L + R) / 2LL;
      if (a[M] < (r + 1LL) * x)
        L = M;
      else
        R = M;
    }
    if (a[L] < (r + 1LL) * x) {
      cnt[a[i]] = L - index + 1;
      ans += cnt[a[i]];
    }
  }
  cout << ans;
  return 0;
}
