fun main(args:Array<String>) {
	val (n,m,x) = readLine()!!.split(" ").map{ it.toInt() }
	val a = readLine()!!.split(" ").map{ it.toInt() }
	println( Math.min(
			a.count{ it<x },
			a.count{ it>x }
	))
}