#include <bits/stdc++.h>
using namespace std;
int n, m, k, b[1000000 + 5];
void clean() { memset(b, 0, sizeof b); }
void solve() {
  clean();
  for (int x, i = 1; i <= n; i++) scanf("%d", &x), b[x] = 1;
  int ans = 0, cnt = 0;
  for (int i = 1; i <= 1000000; i++) {
    if (i - m >= 0 && b[i - m]) cnt--;
    if (b[i]) cnt++;
    if (cnt >= k) b[i] = 0, ans++, cnt--;
  }
  printf("%d\n", ans);
}
int main() {
  scanf("%d%d%d", &n, &m, &k), solve();
  return 0;
}
