let read_int_array n = Array.init n (fun _ -> Scanf.scanf " %d" (fun x -> x))

let ans n k a =
  let rec solve i sum ret =
    if i = n then ret
    else if sum + a.(i) < k then solve (i + 1) (sum + a.(i)) (ret + 1)
    else solve (i + 1) sum 0
  in solve 0 0 0

let () =
  let n, k = Scanf.scanf "%d %d" (fun n k -> n, k) in
  let a = read_int_array n in
  Array.sort (fun x y -> - x + y) a;
  print_int (ans n k a)
