#include <bits/stdc++.h>
using namespace std;
int n, m, k, ans, x, i, sum;
int used[1000006];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  for (i = 1; i <= n; ++i) {
    cin >> x;
    used[x] = true;
  }
  for (i = 1; i <= 1000001; ++i) {
    sum = sum + used[i];
    sum = sum - used[max(0, i - m)];
    if (sum == k) used[i] = 0, sum--, ans++;
  }
  cout << ans;
}
