let read_int_list () =
    read_line ()
    |> Str.split (Str.regexp " ")
    |> List.map int_of_string

let () =
    let [n; _; x] = read_int_list () in
    let a = read_int_list () in
    let count_lesser =
        List.filter (fun n -> n < x) a
        |> List.length
    in
    let count_greater =
        List.filter (fun n -> n > x) a
        |> List.length
    in
    print_endline (string_of_int (min count_lesser count_greater))
