#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000;
int main() {
  int n, m, k, arr[maxn + 5] = {0}, now = 0, ans = 0;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  sort(arr, arr + n);
  for (int t = 1, r = 0, l = 0; t <= arr[n - 1]; t++) {
    while (!arr[l] || arr[l] && arr[l] <= t - m)
      if (arr[l++] != 0) now--;
    if (arr[r] == t) {
      now++;
      r++;
    }
    if (now >= k) {
      arr[r - 1] = 0;
      now--;
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
