
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 c k 0 ts

solve :: Int -> Int -> Int-> [Int] ->Int
solve c k a tt=solve1 a tt
  where
    solve1 ::Int->[Int]->Int
    solve1 ans []=ans
    solve1 ans ts@(t:_)=solve1 (ans+1) (f ts)
      where
        f::[Int]->[Int]
        f=if (ts!!((min c $ length ts)-1))>(t+k) then (dropWhile (<t+k)) else (drop c)
