#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
int a[maxn];
int main() {
  int n, m, k, num, res = 0, tot = 0;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) a[i] = 0;
  for (int i = 1; i <= n; ++i) scanf("%d", &num), a[num] = 1;
  for (int i = 1; i <= 1e6; ++i) {
    if (a[i]) ++tot;
    if (i > m && a[i - m]) --tot;
    if (tot == k) {
      --tot;
      ++res;
      a[i] = 0;
    }
  }
  printf("%d\n", res);
  return 0;
}
