n = STDIN.gets.to_i
a, b = STDIN.gets.split.map(&:to_i)
points = STDIN.gets.split.map(&:to_i)

problem_a = 0
problem_b = 0
problem_c = 0

points.each do |point|
  if point <= a
    problem_a += 1
  elsif point >= a + 1 && point <= b
    problem_b += 1
  else point >= b + 1
    problem_c += 1
  end
end

p [problem_a, problem_b, problem_c].min
