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