
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)


main::IO()
main=do
  [n,c,k]<-map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
  ts <- sort . map (fst . fromJust . BC.readInt) <$> replicateM n BC.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
  
