#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:300000000")
using namespace std;
const int maxlen = (int)(1e5) + 10;
const int base = (int)(1e9);
const long long mod = 1000 * 1000 * 1000 + 7;
const long long bigmod = 99194853094755497ll;
const long long infinity = (long long)1e18;
const int NSeg = 1 << 17;
long long a[maxlen];
map<long long, long long> M;
int main() {
  long long n, x, k;
  scanf("%I64d %I64d %I64d", &n, &x, &k);
  for (long long i = 0; i < n; ++i) {
    scanf("%I64d", &a[i]);
    M[a[i]]++;
  }
  sort(a, a + n);
  long long ans = 0;
  if (k == 0) {
    for (int i = 0; i < n; ++i) {
      if (a[i] % x == 0) continue;
      long long x1 = ((a[i] + x - 1) / x) * x;
      int l = lower_bound(a, a + n, x1) - a;
      int l1 = upper_bound(a, a + n, a[i] - 1) - a;
      ans += l - l1;
    }
    printf("%I64d", ans);
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    long long k1 = a[i] / x;
    long long q = (a[i] - 1) / x;
    long long l, r;
    l = 0;
    r = infinity + 1;
    while (r - l > 1) {
      long long m = (r + l) / 2;
      long long q1 = m / x;
      if (q1 - q < k)
        l = m;
      else
        r = m;
    }
    long long X = r;
    long long Y = r + x - 1;
    int lX = upper_bound(a, a + n, X - 1) - a;
    int lY = upper_bound(a, a + n, Y) - a;
    ans += lY - lX;
  }
  printf("%I64d", ans);
  return 0;
}
