open Batteries

let calc x li =
  let rec aux c = function
    | [] -> c
    | a :: al when a + c <= x -> aux (1 + c) al
    | a :: al -> c
  in
  aux 0 li

let () =
  Scanf.scanf " %d %d " (fun n x ->
      let ans =
        List.init n (fun _ -> Scanf.scanf " %d" (fun x -> x))
        |> List.sort (fun x y -> x - y)
        |> calc x
      in
      (if ans = n then n - 1 else ans) |> Printf.printf "%d\n" )
