#include <bits/stdc++.h>
const int N = 100005;
const long double pi = 3.141592653;
const long long MOD = 1000000007;
using namespace std;
int dx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    int n, m, k, i, ans = 0;
    cin >> n >> m >> k;
    vector<int> a(n);
    for (i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    set<int> s;
    for (i = 0; i < n; i++) {
      while (*s.begin() < a[i] - m + 1 && (int)s.size() > 0) s.erase(s.begin());
      if ((int)s.size() < k - 1)
        s.insert(a[i]);
      else
        ans++;
    }
    cout << ans;
  }
  return 0;
}
