DBG = true
n = gets.to_i
a,b = gets.split.map{|x| x.to_i}
p = gets.split.map{|x| x.to_i}
n1 = 0
n2 = 0
n3 = 0
for i in p
  if i <= a
    n1 += 1
  elsif i <= b
    n2 += 1
  else
    n3 += 1
  end
end
print [n1,n2,n3].min 
