#include <bits/stdc++.h>
using namespace std;
int a[100010], d[100010];
map<int, int> m;
int main() {
  int n, x, k;
  cin >> n >> x >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  long long cnt = 0, y;
  for (int i = n; i >= 1; i--) {
    int l = i;
    while (a[i] == a[i - 1]) i--;
    for (int j = l; j >= i; j--) {
      d[j] = a[j] / x;
      m[d[j]]++;
    }
    for (int j = l; j >= i; j--) {
      y = (long long)m[(a[i] - 1) / x + k];
      cnt += y;
    }
  }
  cout << cnt;
  return 0;
}
