#include <bits/stdc++.h>
using namespace std;
int a[200100];
deque<int> Q;
bool cnt[10001000];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> a[i], cnt[a[i]] = true;
  sort(a, a + n);
  int Min = a[0], Max = a[n - 1], Ans = 0;
  for (int i = Min; i <= 1e7; i++) {
    if (Q.size() && Q.front() < i - m) Q.pop_front();
    if (i >= Min + m - 1)
      while (Q.size() >= k) Q.pop_back(), Ans++;
    if (cnt[i]) Q.push_back(i);
  }
  cout << Ans;
  return 0;
}
