fun main(args : Array<String>){

    val (n,m,x) = readLine()!!.split(' ').map { it.toInt() }
    val a = readLine()!!.split(' ').map { it.toInt() }

    var prev = 0
    var nxt = 0

    for(i in 0..a.size-1){
        if(a[i] > x)prev++
        else nxt++
    }

    println(Math.min(prev,nxt))

}
