#include <bits/stdc++.h>
using namespace std;
map<int, int> m, cnt;
int a[100005];
int main() {
  int n, x, k;
  scanf("%d%d%d", &n, &x, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  long long res = 0;
  for (int i = n - 1; i >= 0; i--) {
    int t = a[i] / x, norem = (a[i] % x ? 0 : 1);
    if (k - norem >= 0) {
      res += m[t + k - norem];
      if (t == t + k - norem) res += cnt[a[i]] + 1;
    }
    cnt[a[i]]++;
    m[t]++;
  }
  cout << res;
  return 0;
}
