#include <bits/stdc++.h>
using namespace std;
long long int n, a, b;
using namespace std;
const int MX = 1e6 + 10;
int sum[MX << 2], add[MX << 2];
void build(int l, int r, int rt) {
  sum[rt] = 0;
  if (l == r) return;
  int m = (l + r) >> 1;
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
}
void PushDown(int m, int rt) {
  if (add[rt]) {
    sum[rt << 1] += add[rt] * (m - (m >> 1));
    sum[rt << 1 | 1] += add[rt] * (m >> 1);
    add[rt << 1] += add[rt];
    add[rt << 1 | 1] += add[rt];
    add[rt] = 0;
  }
}
void PushUP(int rt) { sum[rt] = sum[rt << 1] + sum[rt << 1 | 1]; }
void update(int L, int R, int c, int l, int r, int rt) {
  if (L <= l && R >= r) {
    sum[rt] += c * (r - l + 1);
    add[rt] += c;
    return;
  }
  PushDown(r - l + 1, rt);
  int m = (l + r) >> 1;
  if (L <= m) update(L, R, c, l, m, rt << 1);
  if (R > m) update(L, R, c, m + 1, r, rt << 1 | 1);
  PushUP(rt);
}
int query(int L, int R, int l, int r, int rt) {
  if (L <= l && R >= r) return sum[rt];
  PushDown(r - l + 1, rt);
  int m = (l + r) >> 1;
  int ret = 0;
  if (L <= m) ret += query(L, R, l, m, rt << 1);
  if (R > m) ret += query(L, R, m + 1, r, rt << 1 | 1);
  PushUP(rt);
  return ret;
}
int as[MX];
int top = 0;
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  int ans = 0;
  int cnt = 0;
  build(1, MX, 1);
  int num;
  for (int i = 0; i < n; i++) {
    scanf("%d", &as[i]);
    top = max(top, as[i]);
  }
  sort(as, as + n);
  for (int i = 0; i < n; i++) {
    cnt = as[i];
    num = query(cnt, cnt, 1, top, 1);
    if (num < k - 1) {
      update(cnt, min(cnt + m - 1, top), 1, 1, top, 1);
    } else {
      ans++;
    }
  }
  cout << ans << endl;
}
