let n, m, x = Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c - 1
let a_s = Array.init m @@ fun _ -> Scanf.scanf " %d" pred
let ans = ref @@ max_int
let f n = Array.fold_left (fun c a -> if a = n then 1 else c) 0 a_s
let _ = let c = ref 0 in for i = 0 to x - 1 do c := !c + f i done;
  ans := !c; let c = ref 0 in for i = x + 1 to n - 1 do c := !c + f i done;
  ans := min !ans !c; Printf.printf "%d\n" !ans