#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int maxn = 110;
const int maxm = 1000010;
int luna[maxm];
int main(int argc, char const *argv[]) {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    int tmp;
    cin >> tmp;
    luna[tmp]++;
  }
  int cnt = 0;
  int ans = 0;
  for (int i = 1; i < maxm; i++) {
    if (i - m > 0 && luna[i - m]) cnt--;
    if (luna[i]) cnt++;
    if (cnt >= k) luna[i] = 0, cnt--, ans++;
  }
  cout << ans << endl;
  return 0;
}
