let () =
let n, m, x = Scanf.scanf "%d %d %d\n" (fun a b c -> a, b, c) in
let lst = Array.to_list (Array.init m (fun _ -> Scanf.scanf "%d " (fun x -> x))) in
let head = List.length (List.filter (fun a -> a < x) lst) in
let tail = List.length (List.filter (fun a -> a > x) lst) in
Printf.printf "%d\n" (min head tail)