#include <bits/stdc++.h>
using namespace std;
vector<long long> ok(1000001);
long long n, m, k;
int main() {
  cin >> n >> m >> k;
  long long h;
  for (long long int i = 0; i < n; i++) {
    cin >> h;
    ok[h] = 1;
  }
  long long k1, f = 1, cur = 0;
  vector<long long> v;
  for (long long int i = 1; i < m + 1; i++) {
    if (ok[i] == 1) {
      cur++;
    }
    if (cur >= k) {
      f = 0;
      if (ok[i] == 1) {
        v.push_back(i);
        ;
      }
    }
  }
  long long ans = 0;
  if (f == 0) {
    ans += v.size();
    for (long long int i = 0; i < v.size(); i++) {
      ok[v[i]] = 0;
    }
    cur -= v.size();
  }
  if (ok[1] == 1) {
    cur--;
  }
  for (long long int i = 1; i < (1000000 - m + 1); i++) {
    if (ok[i + m] == 1) {
      cur++;
    }
    if (cur >= k) {
      ans++;
      ok[i + m] = 0;
      cur--;
    }
    if (ok[i + 1] == 1) {
      cur--;
    }
  }
  cout << ans << "\n";
  return 0;
}
