#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  while (b) {
    a %= b, swap(a, b);
  }
  return a;
}
inline long long lcm(long long a, long long b) {
  return a * b / max(1LL, gcd(a, b));
}
mt19937 Random((long long)time(0));
inline long long rnd(long long x) { return Random() % x; }
const long long INF = (long long)1e9 + 2017;
const long long MOD = (long long)1e9 + 7;
const long double EPS = 1e-10;
const long double PI = acos(-1.0);
const long long N = 1e5 + 10;
long long arr[N];
long long get1(long long a, long long x, long long k) {
  long long l = a - 1, r = INF, m;
  while (l + 1 < r) {
    m = (l + r) / 2;
    if (m / x - (a - 1) / x >= k) {
      r = m;
    } else {
      l = m;
    }
  }
  return r;
}
long long get2(long long a, long long x, long long k) {
  long long l = a, r = INF, m;
  while (l + 1 < r) {
    m = (l + r) / 2;
    if (m / x - (a - 1) / x > k) {
      r = m;
    } else {
      l = m;
    }
  }
  return l;
}
void source() {
  long long n, k, x;
  cin >> n >> x >> k;
  for (long long i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  long long ans = 0;
  for (long long i = 0; i < n; ++i) {
    long long l = get1(arr[i], x, k), r = get2(arr[i], x, k);
    if (!(l == r && l % x == 0 && !k)) {
      ans += upper_bound(arr, arr + n, r) - lower_bound(arr, arr + n, l);
    }
  }
  cout << ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios_base::fixed, ios_base::floatfield);
  cout.precision(10);
  source();
}
