def main(argv)
  n = gets.chomp.to_i
  (a, b) = gets.chomp.split(' ').map(&:to_i)
  p = gets.chomp.split(' ').map(&:to_i)

  counter = [0, 0, 0]
  n.times do |i|
    counter[0] += 1 if (p[i] <= a)
    counter[1] += 1 if ((a < p[i]) && (p[i] <= b))
    counter[2] += 1 if (b < p[i])
  end

  puts counter.min.to_s
end

if self.to_s == 'main' then
  main(ARGV)
end