let () = Scanf.scanf "%d\n%d %d\n" @@ fun n a b ->
  let ps =
    Array.to_list @@
    Array.init n @@ fun _ ->
      Scanf.scanf "%d " @@ fun p -> p in
  Printf.printf "%d\n" @@
    List.fold_left min max_int @@
    List.map List.length
    [ List.filter (fun p -> p <= a) ps;
      List.filter (fun p -> a < p && p <= b) ps;
      List.filter (fun p -> b < p) ps ]

