N=gets.to_i
A,B=gets.split.map &:to_i
P=gets.split.map &:to_i
c=0
while true do
    p1=P.index{|x|x<=A}
    if !p1 then break end
    P.delete_at(p1)
    p2=P.index{|x|x>A&&x<=B}
    if !p2 then break end
    P.delete_at(p2)
    p3=P.index{|x|x>B}
    if !p3 then break end
    P.delete_at(p3)
    c+=1
end
p c