Scanf.scanf "%d %d %d" (fun n c k ->
    let t = Array.init n (fun _ -> Scanf.scanf " %d" (fun t -> t )) in
    Array.sort compare t;
    
    let rec loop i cur pop buses =
        if i = n then (if pop > 0 then buses + 1 else buses) else
            let tt = t.(i) in
            if tt <= cur + k then (
                if pop < c then loop (i + 1) cur (pop + 1) buses else
                                loop (i + 1) tt  1 (buses + 1)
            ) else (
                let buses = if pop > 0 then buses + 1 else buses in
                loop (i + 1) tt 1 buses
            )
    in
    loop 0 0 0 0 |> Printf.printf "%d\n"
)