#include <bits/stdc++.h>
const double pi = acos(-1);
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b != 0) {
    if (b & 1) res *= a;
    a *= a;
    b >>= 1;
  }
  return res;
}
using namespace std;
long long MX = 1e6 + 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int cnt = 0, n, m, k, ans = 0;
  cin >> n >> m >> k;
  vector<bool> a(MX);
  for (int i = 0; i < n; i++) {
    int time;
    cin >> time;
    a[time] = 1;
  }
  if (n < k)
    cout << "0\n";
  else {
    for (int i = 1; i < m + 1; i++) {
      if (a[i]) {
        if (cnt == k - 1) {
          ans++, a[i] = 0;
        } else
          cnt++;
      }
    }
    for (int i = 2; i < MX - m + 1; i++) {
      if (a[i - 1] == 1) cnt--;
      if (a[i + m - 1] == 1) {
        if (cnt == k - 1) {
          ans++, a[i + m - 1] = 0;
        } else
          cnt++;
      }
    }
    cout << ans << "\n";
  }
}
