def ascan; gets.split.map(&:to_i); end

N = gets.to_i
A, B = ascan
P = ascan

x1 = 0
x2 = 0
x3 = 0

P.each do |pt|
    x1 += 1 if pt <= A
    x2 += 1 if A < pt && pt <= B
    x3 += 1 if B < pt
end

p [x1,x2,x3].min