n = io.read("*n")
a, b = io.read("*n", "*n")
t = {0, 0, 0}
for i = 1, n do
  p = io.read("*n")
  if p <= a then
    t[1] = t[1] + 1
  elseif p <= b then
    t[2] = t[2] + 1
  else
    t[3] = t[3] + 1
  end
end
print(math.min(table.unpack(t)))
