import Control.Monad
import Data.List

main::IO()
main=do
  [n,c,k]<-(map read) . words <$> getLine
  ts <- sort . (map read) <$> replicateM n getLine
  print $ solve 0 c k ts

solve :: Int -> Int -> Int-> [Int] ->Int
solve ans _ _ []=ans
solve ans c k ts =if (num>lim)
  then solve (ans+1) c k (dropWhile (<lim) ts)
  else solve (ans+1) c k (drop c ts)
  where
    lim = (head ts)+k
    num = if length ts > c then ts !! (c-1) else last ts
  
