#include <bits/stdc++.h>
using namespace std;
int b[1000005];
int main() {
  ios::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) b[a[i]] = 1;
  int sum = 0, result = 0, len = 0;
  for (int i = 0; i < 1000005; i++) {
    sum += b[i];
    len++;
    if (len == m + 1 && i - m >= 0) {
      sum -= b[i - m];
      len--;
    }
    if (sum >= k) {
      sum--;
      result++;
      b[i] = 0;
    }
  }
  cout << result << endl;
}
