{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

readi b | Just (n, _) <- B.readInt b = n

solve :: Int -> Int -> Int -> [Int] -> Int
solve n c k ts = go 0 0 (head ts) ts
  where
    go !p q _ []
        | q == 0    = p
        | otherwise = p + 1
    go !p q r (x:xs)
        | q == c    = go (p + 1) 0 x (x:xs)
        | x > r + k = go (p + 1) 0 x (x:xs)
        | otherwise = go p (q + 1) r xs

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