let N = Int(readLine()!)!
let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let A = input[0], B = input[1]
let P = readLine()!.characters.split(" ").map{Int(String($0))!}
var problems = [0, 0, 0]
for i in P {
  switch i {
  case 1...A:
    problems[0] += 1
  case A+1...B:
    problems[1] += 1
  default:
    problems[2] += 1
  }
}
print(problems.minElement()!)