#include <bits/stdc++.h>
using namespace std;
int clk[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  int arr[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    clk[arr[i]] = 1;
  }
  int cnt = 0, off = 0;
  for (int i = 1; i <= 1e6; i++) {
    if (clk[i]) cnt++;
    if (i > m && clk[i - m]) {
      cnt--;
      clk[i - m] = 0;
    }
    if (cnt >= k) {
      off++;
      cnt--;
      clk[i] = 0;
    }
  }
  cout << off << endl;
}
