n=gets.to_i
a,b=gets.chomp.split(" ").map(&:to_i)
fristQuestions=[]
secondQuestions=[]
thirdQuestions=[]
gets.chomp.split(" ").map(&:to_i).each do |value|
  if value<=a
    fristQuestions << value
  elsif value>=a+1 && value<=b
     secondQuestions << value
  else
    thirdQuestions << value
  end
end
puts [fristQuestions.count, secondQuestions.count, thirdQuestions.count].min