(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let () = 
        Scanf.sscanf (read_line ()) "%d %d %d" (
                fun n m x -> 
                        let lst = Str.split (Str.regexp " ") (read_line ()) |> List.map int_of_string in
                        let ln = List.length (List.filter (fun elmnt -> elmnt < x) lst) in
                        let rn = List.length (List.filter (fun elmnt -> elmnt > x) lst) in
                                if ln < rn then ln else rn
        ) |> Printf.printf "%d\n"
