#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, arr[100005], x, k;
  cin >> n >> x >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long int offset = (arr[0] - 1) / x;
  long long int dp[100005] = {0}, dp2[100005] = {0};
  dp[0] = (arr[0] / x) - offset;
  dp2[0] = 0;
  for (int i = 1; i < n; i++) {
    dp[i] = (arr[i] / x) - offset;
    dp2[i] = (arr[i] - 1) / x - offset;
  }
  long long int left;
  long long int right;
  long long int mid;
  long long int leftans = -1;
  long long int rightans = -1;
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    leftans = -1;
    rightans = -1;
    left = (lower_bound(arr, arr + n, arr[i]) - &arr[0]);
    right = n - 1;
    while (left <= right) {
      mid = (left + right) / 2;
      if (dp[mid] - dp2[i] == k) {
        leftans = mid;
        right = mid - 1;
      } else if (dp[mid] - dp2[i] > k) {
        right = mid - 1;
      } else if (dp[mid] - dp2[i] < k) {
        left = mid + 1;
      }
    }
    left = (lower_bound(arr, arr + n, arr[i]) - &arr[0]);
    right = n - 1;
    while (left <= right) {
      mid = (left + right) / 2;
      if (dp[mid] - dp2[i] == k) {
        rightans = mid;
        left = mid + 1;
      } else if (dp[mid] - dp2[i] > k) {
        right = mid - 1;
      } else if (dp[mid] - dp2[i] < k) {
        left = mid + 1;
      }
    }
    if (rightans != -1) ans += (rightans - leftans + 1);
  }
  cout << ans << endl;
}
