object Main {

	def main(arg:Array[String]) = {
		val Array(n, m, x) = scala.io.StdIn.readLine().trim.split(" ").map(_.toInt);
		val a = scala.io.StdIn.readLine().split(' ').map(_.toInt);
		var left = 0;
		var right = 0;
		for (i <- a) {
			if (i < x) left = left + 1;
			else if (i > x) right = right + 1;
		}
		if (left < right) println(left);
		else println(right);
	}
}