
object Main extends App {
  val sc = new java.util.Scanner(System.in) 
  val n = sc.nextInt()
  val m = sc.nextInt()
  val x = sc.nextInt()
  sc.useDelimiter("\n")
  val a = sc.next().split(" ").map(_.toInt).toList
  val up = a.filter(a => a > x).length
  val down = a.filter(a => a < x).length
  println(up.min(down))
}
