let id x = x

let (n,c,k) = Scanf.scanf "%d %d %d\n" (fun n c k -> (n,c,k))
  
let repeat f =
  let rec loop acc = function
    | 0 -> List.rev acc
    | n -> loop (f () :: acc) (n-1) in
  loop []

let t = repeat (fun () -> Scanf.scanf "%d\n" id) n

let rec partition n a b = function
  [] -> (a, b)
| x::xs -> if x < n then partition n (x::a) b xs
              else partition n a (x::b) xs

let rec quick_sort = function
  [] -> []
| x::xs ->
    let (m, n) = partition x [] [] xs in
    quick_sort m @ (x :: quick_sort n)

let tlist = quick_sort t

let check' tlist c k =
let rec check tlist ans t' d cnt =
  match tlist with
  | [] -> ans
  | hd :: rest -> if hd > t' then check tlist ans hd d cnt else
     match cnt with
     | 0 -> check rest ans t' (hd+k) (cnt+1)
     | _ -> if t' > d || cnt = c then check tlist (ans + 1) t' d 0
             else check rest ans t' d (cnt+1)
in check tlist 1 1 0 0

let ans = check' tlist c k

let () = Printf.printf "%d\n" ans