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