#include <bits/stdc++.h>
const long long N = 1123456;
using namespace std;
inline long long read() {
  char c = getchar();
  long long t = 0, f = 1;
  while (!isdigit(c)) f = (c == '-') ? -1 : 1, c = getchar();
  while (isdigit(c)) t = t * 10 + c - 48, c = getchar();
  return t * f;
}
long long n, k, x, res;
void solution() {
  cin >> n >> x >> k;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) v[i] = read();
  sort(v.begin(), v.end());
  vector<long long>::iterator l, r;
  for (long long i = 0; i < n; i++) {
    l = lower_bound(v.begin(), v.end(), max(v[i], x * (k + (v[i] - 1) / x)));
    r = lower_bound(v.begin(), v.end(),
                    max(v[i], x * (k + 1 + (v[i] - 1) / x)));
    res += r - l;
  }
  cout << res;
}
int32_t main() {
  long long t = 1;
  while (t--) solution();
}
