import           Control.Monad
import           Data.List

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

solve :: Int -> Int -> [Int] -> Int
solve c k [] = 0
solve c k ts@(t:ts0) = 1 + solve c k (us2 ++ ts2)
    where
        (ts1, ts2) = span (<= t + k) ts
        (us1, us2) = splitAt c ts1