#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  set<int> alarms;
  int last_alarm = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    last_alarm = max(a, last_alarm);
    alarms.insert(a);
  }
  int alarms_to_switch_off = 0;
  int number = 0;
  int ut = 0;
  int lt = 1;
  while (ut < last_alarm) {
    ++ut;
    if (alarms.count(ut)) ++number;
    if (ut - lt >= m) {
      if (alarms.count(lt)) --number;
      ++lt;
    }
    if (number >= k) {
      alarms.erase(ut);
      --number;
      ++alarms_to_switch_off;
    }
  }
  cout << alarms_to_switch_off << endl;
}
