import Control.Applicative
import Data.List
import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Control.Arrow

readIntBS = fst . fromJust . BS.readInt

main = do
  [n,c,k] <- map read . words <$> getLine :: IO [Int]
  ts <- sort . map readIntBS . BS.lines <$> BS.getContents :: IO [Int]

  print $ length $ solve ts c k

  where
    solve [] _ _ = []
    solve xs c k = a : solve b c k
      where
        (a,b) = aux (head xs) xs 1
        aux _ [] _ = ([],[])
        aux t0 (x:xs) c0 = if c0 <= c && x <= t0+k then first (x:) (aux t0 xs (c0+1)) else ([],x:xs) 
      
