fun main(args : Array<String>) {
    val (n, m, v, p) = readLine()!!.split(" ").map { it.toLong() }
    val aa = readLine()!!.split(" ").map { it.toLong() }.sortedDescending()

    var cnt = 0L
    var min = -1L
    var minSum = 0L
    var lastIndex = 0

    repeat(n.toInt()) {
        if (it < p) {
            cnt++
            if (aa[it] != min) {
                min = aa[it]
                minSum = min
                lastIndex = it
            } else {
                minSum += min
            }
            return@repeat
        }

        if (min == aa[it]) {
            cnt++
            minSum += min
            return@repeat
        }

        val max = aa[it] + m
        if (max < min) {
            println(cnt)
            return
        }

        val countUpSafely = (n - it) + lastIndex
        if (v <= countUpSafely) {
            cnt++
            minSum += aa[it]
            return@repeat
        }

        val vNeeded = v - countUpSafely
        val voteSum = minSum + (m * vNeeded)
        val itemCnt = it - lastIndex
        if (voteSum <= itemCnt * max) cnt++
        minSum += aa[it]
    }

    println(cnt)
}