#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
Tp Max(const Tp &a, const Tp &b) {
  return a > b ? a : b;
}
template <typename Tp>
Tp Min(const Tp &a, const Tp &b) {
  return a < b ? a : b;
}
template <typename Tp>
void Read(Tp &x) {
  Tp in = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    in = in * 10 + ch - '0';
    ch = getchar();
  }
  x = in * f;
}
const int SM = 1000000 + 25;
const int SN = 200000 + 25;
int sum[SM << 3], add[SM << 3];
int n, m, y, z, k, num, x, cnt, ans, b;
int A[SN];
void pushup(int rt) { sum[rt] = Max(sum[rt << 1], sum[rt << 1 | 1]); }
void pushdown(int rt, int l, int r) {
  int mid = (l + r) >> 1;
  sum[rt << 1] += add[rt], sum[rt << 1 | 1] = sum[rt << 1 | 1] + add[rt];
  add[rt << 1 | 1] = add[rt << 1 | 1] + add[rt], add[rt << 1] += add[rt],
                add[rt] = 0;
}
void Modify(int rt, int QL, int QR, int l, int r, int k) {
  if (QL <= l && r <= QR) {
    sum[rt] += k;
    add[rt] += k;
    return;
  }
  int mid = (l + r) >> 1;
  pushdown(rt, l, r);
  if (QR > mid) Modify(rt << 1 | 1, QL, QR, mid + 1, r, k);
  if (QL <= mid) Modify(rt << 1, QL, QR, l, mid, k);
  pushup(rt);
}
int Query(int rt, int QL, int QR, int l, int r) {
  int ans = 0;
  if (QL <= l && r <= QR) return sum[rt];
  int mid = (l + r) >> 1;
  pushdown(rt, l, r);
  if (QL <= mid) ans = Max(ans, Query(rt << 1, QL, QR, l, mid));
  if (QR > mid) ans = Max(ans, Query(rt << 1 | 1, QL, QR, mid + 1, r));
  return ans;
}
int res;
int main() {
  Read(n), Read(m), Read(k);
  for (int i = 1; i <= n; i++) Read(A[i]), b = Max(A[i], b);
  int now;
  res = b + m + 1;
  sort(A + 1, A + n + 1);
  for (int i = 1; i <= n; i++) {
    now = Query(1, A[i], A[i] + m - 1, 1, res);
    if (now != k - 1)
      Modify(1, A[i], A[i] + m - 1, 1, res, 1);
    else
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}
