#include <bits/stdc++.h>
using namespace std;
int pos[1000007];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> V;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    pos[x] = 1;
  }
  int ans = 0;
  deque<int> dq;
  for (int i = 1; i <= 1000000; i++) {
    if (pos[i]) {
      dq.push_back(i);
    }
    while (dq.size() >= k) {
      dq.pop_back();
      ans++;
    }
    while (dq.size() && (i - dq.front() + 1) >= m) {
      dq.pop_front();
    }
  }
  cout << ans << endl;
  return 0;
}
