n = gets.to_i
a, b = gets.split(" ").map!{|i| i.to_i}
p = gets.split(" ").map!{|i| i.to_i}
atime = 0
btime = 0
ctime = 0
p.length.times do |i|
  if p[i] <= a 
    atime += 1
  elsif p[i] > a and p[i] <= b
    btime += 1
  else ctime += 1
  end
end
h = [atime, btime, ctime]
p h.min