#include <bits/stdc++.h>
using namespace std;
const long long INF = 4e18;
const long long MAXN = +100500;
long long a[MAXN];
long long n;
long long x, k;
long long func(long long n1, long long n2) {
  if (n2 > n1) swap(n1, n2);
  long long ret = 0;
  n1 = a[n1];
  n2 = a[n2];
  if (n2 % x == 0) ret++;
  ret += (n1 / x - n2 / x);
  return ret;
}
long long bs1(long long ind) {
  long long l = 0;
  long long r = n + 1;
  while (r - l > 1) {
    long long mid = (r + l) / 2;
    if (mid == 0) return 0;
    if (a[mid] < a[ind]) {
      l = mid;
      continue;
    }
    if (func(mid, ind) > k) {
      r = mid;
    } else {
      l = mid;
    }
  }
  return l;
}
long long bs2(long long ind) {
  long long l = 0;
  long long r = n + 1;
  while (r - l > 1) {
    long long mid = (r + l) / 2;
    if (mid == 0) return 0;
    if (a[mid] < a[ind]) {
      l = mid;
      continue;
    }
    if (func(mid, ind) < k) {
      l = mid;
    } else {
      r = mid;
    }
  }
  return l;
}
int main() {
  cin >> n >> x >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long r = bs1(i);
    long long l = bs2(i);
    ans += r - l;
  }
  cout << ans;
}
