def get_int
  gets.to_i
end

def get_int_array
  gets.chomp.split(' ').map(&:to_i)
end

def main
  n = get_int
  ab = get_int_array
  a = ab[0]
  b = ab[1]

  p_s = get_int_array.sort

  a_candidates = p_s.select{|p| p <= a }
  b_candidates = p_s.select{|p| p > b }
  others = p_s - a_candidates - b_candidates

  p [a_candidates.length, b_candidates.length, others.length].min
end

main
