import Data.List
import Control.Monad

solve :: [Int] -> Int -> Int -> Int -> Int -> Int
solve [] _ _ _ _ = 1
solve (t:rs) ti 0 c k = 1 + solve rs (t + k) (c - 1)c k
solve (t:rs) ti count c k
  | t <= ti = solve rs ti next_c c k
  | True = 1 + solve rs (t + k) (c - 1) c k
    where
      next_c = count - 1

main :: IO ()
main = do
  n:c:k:_ <- fmap (\x -> read x :: Int) <$> words <$> getLine
  h:ts <- sort <$> fmap (\x -> read x :: Int) <$> replicateM n getLine
  print $ solve ts (h + k) (c - 1) c k
