open Scanf
open Printf

let read_ints () =
  read_line ()
  |> String.split_on_char ' '
  |> List.map int_of_string

let () = scanf "%d %d %d\n" (fun n m x ->
  let a = read_ints () in
  let (lefts, rights) = List.partition ((<) x) a in
  printf "%d\n" @@ min (List.length lefts) (List.length rights))
