#include <bits/stdc++.h>
using namespace std;
long long a[100003], ans;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  long long n, x, k;
  cin >> n >> x >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + 1 + n);
  long long tmp, l, r;
  for (int i = 1; i <= n; ++i) {
    tmp = a[i] / x + (a[i] % x != 0);
    if (k == 0)
      l = a[i];
    else
      l = (tmp + k - 1) * x;
    r = (tmp + k) * x;
    ans +=
        (lower_bound(a + 1, a + n + 1, r) - lower_bound(a + 1, a + n + 1, l));
  }
  cout << ans << endl;
  return 0;
}
