import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

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

solve :: Int -> Int -> [Int] -> Int
solve c k ts = f sts 0
  where
    sts = sort ts
    f [] b = b
    f (x:xs) b = f (drop (length es) xs) (b+1)
      where
        ds = takeWhile (\y -> y <= x + k) xs
        es = take (c-1) ds
          
getl :: (String -> a) -> IO a
getl f = f <$> getLine
