object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, A, B = sc.nextInt()
  val grouped = List
    .fill(N)(sc.nextInt())
    .groupBy(i => if (i <= A) "A" else if (i <= B) "B" else "C")
    .view
    .mapValues(_.length)
  println(List("A", "B", "C").map(grouped.getOrElse(_, 0)).min)
}
