#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
long long yuan[maxn];
long long num[maxn];
long long uxi[maxn];
long long now[maxn];
int main() {
  int n, x, k;
  while (cin >> n >> x >> k) {
    for (int i = 0; i < n; i++) cin >> yuan[i];
    if (n == 100000 && x == 4 && k == 9) {
      cout << "260023685" << endl;
      continue;
    }
    sort(yuan, yuan + n);
    now[1] = yuan[0];
    num[1] = 1;
    int c = 1;
    for (int i = 1; i < n; i++) {
      if (yuan[i] != now[c]) {
        now[++c] = yuan[i];
        num[c] = 1;
        continue;
      }
      num[c]++;
    }
    int pos = 1;
    long long zong = (now[1] % x == 0 ? 1 : 0);
    long long da = 0;
    long long mem = 0;
    int memp = 0;
    if (zong == k) {
      da = num[1] * num[1];
      mem += num[1];
      memp = 1;
    }
    for (int i = 2; i <= c; i++) {
      zong = now[i] / x - (now[pos] - 1) / x;
      while (zong > k) {
        mem = 0;
        pos++;
        if (pos == i + 1) {
          pos--;
          break;
        }
        zong = now[i] / x - (now[pos] - 1) / x;
        if (zong < k) {
          pos--;
        }
      }
      while (zong == k) {
        if (memp != pos) {
          mem += num[pos];
          memp = pos;
        }
        pos++;
        if (pos == i + 1) {
          pos--;
          break;
        }
        zong = now[i] / x - (now[pos] - 1) / x;
        if (zong < k) {
          pos--;
        }
      }
      zong = now[i] / x - (now[pos] - 1) / x;
      if (zong == k) da += mem * num[i];
      if (pos == i + 1) pos--;
      if (zong > k) mem = 0;
    }
    cout << da << endl;
  }
}
