open Batteries

let () =
  let n, m, x = Scanf.scanf "%d %d %d\n" (fun a b c -> a, b, c) in

  let arr = Array.make m 0 in
  for i = 0 to m-1-1 do
    let c = Scanf.scanf "%d " (fun c -> c) in
    Array.set arr i c
  done;
  let c = Scanf.scanf "%d\n" (fun c -> c) in
  Array.set arr (m-1) c;

  let l = ref 0 in
  let r = ref 0 in
  for i = 0 to m-1 do
    let v = Array.get arr i in
    if v < x then
      (l := !l + 1)
    else 
      (r := !r + 1)
  done;

  print_endline (string_of_int (
      if (!l > !r) then !r else !l
    ))
