#include <bits/stdc++.h>
using namespace std;
void READ() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(3);
}
const int N = 5 + 1e5;
int n;
long long x, k;
bool f[N];
long long ans, a[N], b[N];
int main() {
  READ();
  cin >> n >> x >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int l, r;
  for (int i = 0; i < n; i++) {
    if (a[i] % x != 0) {
      r = upper_bound(a, a + n, max(a[i], a[i] / x * x + x * k + x - 1)) - a;
      l = lower_bound(a, a + n, max(a[i], a[i] / x * x + x * k)) - a;
      ans += r - l;
    } else {
      if (k == 0) continue;
      r = upper_bound(a, a + n, max(a[i], a[i] / x * x + x * k - 1)) - a;
      l = lower_bound(a, a + n, max(a[i], a[i] / x * x + x * k - x)) - a;
      ans += r - l;
    }
  }
  cout << ans;
  return 0;
}
