#include <bits/stdc++.h>
using namespace std;
void solve() {}
const long long maxn = 100500;
long long a[maxn];
signed main() {
  ios::sync_with_stdio(0);
  cin.sync_with_stdio(0);
  cin.tie(0);
  long long n, x, k;
  cin >> n >> x >> k;
  map<long long, long long> acnt;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    acnt[a[i]]++;
  }
  long long ind = 0;
  vector<pair<long long, long long> > v;
  for (pair<long long, long long> x : acnt) v.emplace_back(x);
  sort(a + 1, a + n + 1);
  map<long long, long long> cnt;
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    while (ind < v.size() and v[ind].first <= a[i]) {
      cnt[(v[ind].first - 1) / x] += v[ind].second;
      ind++;
    }
    long long val = a[i] / x;
    long long desired = val - k;
    ans += cnt[desired];
  }
  cout << ans << '\n';
}
