solver::[Int]->Int->Int->Int
solver ls a b = let under_a = length (filter (a>=) ls) in
                let mid     = length (filter (\ x -> a<x && b>=x) ls) in
                let over_b  = length (filter (b<) ls) in
                minimum [under_a,mid,over_b]

main::IO()
main=do
  _<-getLine
  (a:b:_)<-return.(map read).words=<<getLine
  ls<-return.(map read).words=<<getLine
  print (solver ls a b)
