#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 100;
long long n, a[N], res, x, k;
map<long long, long long> mp, cnt;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> x >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i], cnt[a[i]]++;
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; i++) {
    long long y = a[i] / x;
    res += mp[y - k + 1];
    y = (a[i] + x - 1) / x;
    mp[y]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (k == 0 && a[i] % x != 0) res++;
    if (k == 1 && a[i] % x == 0) res++;
  }
  for (auto y : cnt) {
    if (k == 0 && y.first % x != 0) res += y.second * (y.second - 1) / 2;
    if (k == 1 && y.first % x == 0) res += y.second * (y.second - 1) / 2;
  }
  cout << res;
  return 0;
}
