#include <bits/stdc++.h>
using namespace std;
int dp[2000000 + 342];
int extra[2000000 + 342];
int main() {
  ios::sync_with_stdio(false);
  int n, m, k, tiempo;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> tiempo;
    dp[tiempo]++;
  }
  for (int i = 1; i <= 2000000 + 342; i++) {
    dp[i] += dp[i - 1];
  }
  vector<int> rng;
  int count = 0;
  int tmp = 0;
  int window;
  for (int i = 1; i <= 2000000 + 342; i++) {
    if (i - m > 0) {
      if (extra[i - m] == 1) {
        tmp--;
      }
    }
    window = dp[i];
    if (i - m > 0) {
      window -= dp[i - m];
    }
    if (window - tmp >= k) {
      count++;
      tmp++;
      extra[i] = 1;
    }
    if (rng.size() > 0)
      if (rng[0] < i - m) {
        rng.erase(rng.begin());
      }
  }
  cout << count << "\n";
  return 0;
}
