n=gets.to_i
a,b=gets.split.map(&:to_i)
q=gets.split.map(&:to_i)
aa,bb,cc=[],[],[]
n.times do |i|
  if p[i]<=a
    aa<<p[i]
  elsif p[i]<=b
    bb<<p[i]
  else
    cc<<p[i]
  end
end
p [aa.size,bb.size,cc.size].min
