#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, minuts, k, inpt;
  cin >> n >> minuts >> k;
  vector<char> alarm(10e6 + 2);
  for (int i = 0; i < n; i++) {
    cin >> inpt;
    alarm[inpt] = 1;
  }
  int counter = 0;
  int l = 1;
  int r = 0;
  int answ = 0;
  while (r < minuts) {
    r++;
    if (alarm[r]) {
      if (counter + 1 == k) {
        alarm[r] = 0;
        answ++;
      } else {
        counter++;
      }
    }
  }
  while (r <= 10e6) {
    r++;
    l++;
    if (alarm[l - 1]) {
      counter--;
    }
    if (alarm[r]) {
      if (counter + 1 == k) {
        alarm[r] = 0;
        answ++;
      } else {
        counter++;
      }
    }
  }
  cout << answ;
  return 0;
}
