{-# LANGUAGE BangPatterns #-}
import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import Data.List

main = do
    [_,c,k] <- map read . words <$> getLine
    ts <- map (fst . fromJust . BC.readInt) . BC.lines <$> BC.getContents
    print $ solve c k ts

solve :: Int -> Int -> [Int] -> Int
solve c k = f 0 . sort
    where
        c' = c-1 -- first passanger always inside
        f :: Int -> [Int] -> Int
        f acc [] = acc
        f acc (t:ts) = let packAsMany = dropWhileNoLonger c' (<= t+k)
                            in f (acc+1) (packAsMany ts)

dropWhileNoLonger :: Int -> (a -> Bool) -> [a] -> [a]
dropWhileNoLonger _ _ [] = []
dropWhileNoLonger !l f list@(x:xs)
    | l <= 0    = list
    | otherwise = if f x then dropWhileNoLonger (pred l) f xs
                         else list
