#include <bits/stdc++.h>
using namespace std;
int x[200009];
queue<int> q;
int main() {
  int n, m, i, k, ck = 0, a;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 0; i < n; i++) scanf("%d", &x[i]);
  sort(x, x + n);
  for (i = 0; i < n; i++) {
    if (q.empty()) {
      if (q.size() == k - 1)
        ck++;
      else
        q.push(x[i]);
    } else {
      while (!q.empty() && x[i] - q.front() > m - 1) q.pop();
      if (q.size() == k - 1)
        ck++;
      else
        q.push(x[i]);
    }
  }
  cout << ck << endl;
  return 0;
}
