n = gets.to_i
N, K= gets.chomp.split.map(&:to_i)
d = gets.chomp.split.map(&:to_i)
box1 = []
box2 = []
box3 = []

d.each do |i|
	if i <= N
		box1 << i
	elsif N < i && i <= K
		box2 << i
	else
		box3 << i
	end
end

puts [box1.length, box2.length, box3.length].min