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

problems = P.group_by { |score| 
  case score
  when 0..A
    0
  when (A + 1)..B
    1
  when (B + 1)..Float::INFINITY
    2
  end
}

puts [0, 1, 2].map { |i| (problems[i] || []).size }.min
