numOfQuestions = gets.to_i
restrictions = gets.to_s
questions = gets.to_s

restrictionA = restrictions.split(" ")[0].to_i
restrictionB = restrictions.split(" ")[1].to_i


arrayOfQuestions = []
for times in 0..numOfQuestions-1 do
    arrayOfQuestions << questions.split(" ")[times].to_i
end

array = []

firstQuestion = arrayOfQuestions.count{|question| question <= restrictionA }
secondQustion = arrayOfQuestions.count{|question| question > restrictionA &&  question <= restrictionB}
thirdQuestion = arrayOfQuestions.count{|question| question > restrictionB}

array << firstQuestion
array << secondQustion
array << thirdQuestion

p array.min