n, m, a, b = gets.chomp.split.map(&:to_i)
arr = gets.chomp.split.map(&:to_i)
keep, drop = [], []
k = false
arr.each{|x|
    k = true if x < a
    if k
        keep << x
    else
        drop << x
    end
}
if keep.length < m
    while !drop.empty? && drop.last <= b
        drop.pop
    end
end
puts drop.length
