#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int sol = 0;
  set<int> alarms;
  for (auto &x : a) {
    auto it = alarms.lower_bound(x - m + 1);
    alarms.erase(alarms.begin(), it);
    if (alarms.size() >= k - 1) {
      ++sol;
      continue;
    }
    alarms.insert(x);
  }
  cout << sol << endl;
  return 0;
}
