#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int INFL = 0x3f3f3f3f3f3f3f3f;
const double pi = atan(1.0) * 4.0;
const int N = 1e5 + 500;
vector<long long int> num;
long long int v[N];
long long int maxl(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  long long int n, x, k;
  cin >> n >> x >> k;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    num.push_back(v[i]);
  }
  num.push_back(INFL);
  sort(num.begin(), num.end());
  long long int ans = 0, fst, lst;
  for (int i = 0; i < n; i++) {
    if (v[i] % x == 0)
      fst = v[i];
    else
      fst = v[i] + x - (v[i] % x);
    if (k == 0) {
      if (v[i] % x == 0) continue;
      fst = v[i];
      lst = v[i] + x - (v[i] % x) - 1;
    } else {
      lst = fst + k * x - 1;
      fst = fst + (k - 1) * x;
    }
    int lo = 0, hi = n;
    while (hi != lo) {
      int mid = (hi + lo) / 2;
      if (num[mid] >= fst)
        hi = mid;
      else
        lo = mid + 1;
    }
    fst = lo;
    lo = 0, hi = n;
    while (hi != lo) {
      int mid = (hi + lo + 1) / 2;
      if (num[mid] <= lst)
        lo = mid;
      else
        hi = mid - 1;
    }
    lst = lo;
    if (fst == n) continue;
    ans += maxl(0, lst - fst + 1);
  }
  cout << ans << endl;
  return 0;
}
