import scala.io.StdIn.readLine

object Main extends App {
  val Array(n, m, x) = readLine().split(' ').map(_.toInt)
  val as = readLine().split(' ').map(_.toInt).toSeq
  
  val tollGatesLower = as.filter(_ < x).length
  val tollGatesHigher = as.filter(x < _).length
  println(Seq(tollGatesLower, tollGatesHigher).min)
}