#include <bits/stdc++.h>
using namespace std;
vector<pair<bool, int>> arr(1000001, {false, -1});
vector<int> seg(1000001 * 4);
int n, m, k;
void construct(int i, int l, int r) {
  if (l == r) {
    if (arr[l].first)
      seg[i] = 1;
    else
      seg[i] = 0;
    return;
  }
  int mid = (l + r) / 2;
  construct(2 * i + 1, l, mid);
  construct(2 * i + 2, mid + 1, r);
  seg[i] = seg[2 * i + 1] + seg[2 * i + 2];
}
void update(int i, int l, int r, int index, int val) {
  if (r < index || index < l)
    return;
  else if (l >= index && r <= index) {
    seg[i] = val;
    return;
  }
  int mid = (l + r) / 2;
  update(2 * i + 1, l, mid, index, val);
  update(2 * i + 2, mid + 1, r, index, val);
  seg[i] = seg[2 * i + 1] + seg[2 * i + 2];
}
int query(int i, int l, int r, int low, int high) {
  if (r < low || high < l)
    return 0;
  else if (l >= low && r <= high)
    return seg[i];
  int mid = (l + r) / 2;
  return query(2 * i + 1, l, mid, low, high) +
         query(2 * i + 2, mid + 1, r, low, high);
}
void testtree() {
  while (1) {
    int i, j, k;
    cin >> k >> i >> j;
    if (k == 1)
      cout << query(0, 0, 1000001 - 1, i, j) << endl;
    else
      update(0, 0, 1000001 - 1, i, j);
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    arr[val].first = true;
  }
  int prev = -1;
  for (int i = 1; i < 1000001; i++) {
    arr[i].second = prev;
    if (arr[i].first) prev = i;
  }
  construct(0, 0, 1000001 - 1);
  int start = 1, end = min(m + start - 1, 1000001 - 1), res = 0;
  while (start < 1000001) {
    int tot = query(0, 0, 1000001 - 1, start, end), next = end;
    while (tot >= k) {
      if (!arr[next].first) {
        next = arr[next].second;
      }
      arr[next].first = false;
      update(0, 0, 1000001 - 1, next, 0);
      tot = query(0, 0, 1000001 - 1, start, end);
      res++;
    }
    start++;
    end = min(m + start - 1, 1000001 - 1);
  }
  cout << res << endl;
}
