#include <bits/stdc++.h>
using namespace std;
int a[200005], n, m, k, ans;
queue<int> que;
inline int gi() {
  register int x = 0, q = 1;
  register char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') q = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = getchar();
  return q * x;
}
int main() {
  n = gi(), m = gi(), k = gi();
  for (register int i = 1; i <= n; ++i) a[i] = gi();
  sort(a + 1, a + n + 1);
  for (register int i = 1, pos = 1, tot = 0; i <= 2000000; ++i) {
    while (pos <= n && a[pos] <= i) {
      if (tot + 1 < k) que.push(a[pos]), ++tot, ++ans;
      ++pos;
    }
    while (!que.empty() && que.front() + m - 1 <= i) que.pop(), --tot;
  }
  cout << n - ans;
  return 0;
}
