#include <bits/stdc++.h>
using namespace std;
long long INF = 1e9;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  vector<long long> a(1e6 + 1);
  for (long long i = 0; i < n; i++) {
    long long b;
    cin >> b;
    a[b] = 1;
  }
  n = 1000001;
  long long ans = 0;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    sum += a[i];
    if (i - m >= 0) sum -= a[i - m];
    if (sum >= k) {
      a[i] = 0;
      ans++;
      sum--;
    }
  }
  cout << ans;
  return 0;
}
