import java.util.*

fun main(args:Array<String>?): Unit {
    val (n, m, a, b) = readLine()!!.trim().split(' ').map(String::toInt)
    val leaf = readLine()!!.trim().split(' ').map(String::toInt).toIntArray()
    val stack = Stack<Int>()
    for (l in leaf){
        if (l >= a) stack.add(l)
        else break
    }
    if (n - stack.size < m) {
        while(stack.isNotEmpty() && stack.peek() <= b){
            stack.pop()
        }
    }
    println(stack.size)
}

