let () =
  Scanf.scanf "%d %d %d" @@ fun n a b ->
  let c = Array.init n (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  let x = Array.fold_left (fun s v -> if v <= a then s+1 else s) 0 c in
  let y = Array.fold_left (fun s v -> if v <= b then s+1 else s) 0 c in
  min x (y-x) |> min (n-y) |> Printf.printf "%d\n"