#include <bits/stdc++.h>
using namespace std;
const int max_n = 100000 + 5;
int a[max_n];
int count_mults(int a, int b, int x) {
  int c = b / x - (a - 1) / x;
  return c;
}
int main() {
  int n, x, k;
  scanf("%d %d %d", &n, &x, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  long long ans = 0;
  int min_ptr = 1;
  int max_ptr = 1;
  for (int i = 1; i <= n; ++i) {
    while (min_ptr <= n && a[min_ptr] < a[i]) min_ptr++;
    while (min_ptr <= n && count_mults(a[i], a[min_ptr], x) < k) min_ptr++;
    if (max_ptr < min_ptr) max_ptr = min_ptr;
    while (max_ptr <= n && count_mults(a[i], a[max_ptr], x) <= k) max_ptr++;
    ans += (long long)(max_ptr - min_ptr);
  }
  printf("%I64d\n", ans);
  return 0;
}
