#include <bits/stdc++.h>
using namespace std;
const int boss = 1e5;
int n, x, k, a[boss + 10];
long long sum;
int main() {
  int i;
  scanf("%d%d%d", &n, &x, &k);
  for (i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) {
    long long r = (a[i] - 1) / x + k;
    sum += lower_bound(a + 1, a + n + 1, (r + 1) * x) -
           lower_bound(a + 1, a + n + 1, max(r * x, 1ll * a[i]));
  }
  printf("%lld", sum);
  return 0;
}
