N = gets.to_i
A,B = gets.split.map(&:to_i)
P = gets.split.map(&:to_i)

array1 = Array.new
array2 = Array.new
array3 = Array.new

for i in 0..(N-1)
 if P[i] <= A
  array1.push(P[i])
 elsif A < P[i] && P[i] <= B
  array2.push(P[i])
 elsif B < P[i]
  array3.push(P[i])
 end
end

x = array1.length
y = array2.length
z = array3.length

array4 = Array.new
array4[0] = x
array4[1] = y
array4[2] = z

min = 1000000000000000
for i in 0..2
 if min > array4[i]
  min = array4[i]
 end
end

puts(min)