#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int INF = INT_MAX;
const long long INFLL = (long long)1e18;
const double PI = acos(-1.0);
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
const int N = (int)1e5 + 5;
const int P = 1 << 18;
int n, k, x;
int a[N];
int main() {
  ios::sync_with_stdio(false);
  cout.setf(ios::fixed | ios::showpoint);
  cout.precision(8);
  cin >> n >> x >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long ans = 0;
  int L = 0;
  for (int i = 0; i < n; i++) {
    int left = (a[i] - 1) / x;
    if (i > 0) {
      if (a[i] != a[i - 1]) L = i;
    }
    int l = L, r = n - 1;
    bool flag = false;
    while (l < r - 1) {
      int mid = (l + r) / 2;
      int cur = a[mid] / x - left;
      if (cur == k) flag = true;
      if (cur >= k)
        r = mid;
      else
        l = mid;
    }
    if (a[l] / x - left == k) r = l;
    int l2 = L, r2 = n - 1;
    while (l2 < r2 - 1) {
      int mid = (l2 + r2) / 2;
      int cur = a[mid] / x - left;
      if (cur == k) flag = true;
      if (cur <= k)
        l2 = mid;
      else
        r2 = mid;
    }
    if (a[r2] / x - left == k) l2 = r2;
    if (a[l2] / x - left == k || a[r] / x - left == k) flag = true;
    if (flag) ans += 1ll * (l2 - r + 1);
  }
  cout << ans << endl;
  return 0;
}
