open System

let [|n; m; x|] = stdin.ReadLine().Split() |> Array.map int
let a = stdin.ReadLine().Split() |> Array.map int

let le, ri = Array.partition ((<) x) a

min (Array.length le) (Array.length ri)
|> printfn "%d"