import           Data.Char
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed   as U

main :: IO ()
main = do
  n <- readLn
  [a, b] <- map read . words <$> getLine
  ps <- U.unfoldrN n (B.readInt . B.dropWhile isSpace) <$> B.getLine
  print $ solve a b ps

solve :: Int -> Int -> U.Vector Int -> Int
solve a b = minimum . U.foldl' f [0, 0, 0]
  where
    f [x, y, z] p
      | p <= a    = [x + 1, y, z]
      | p <= b    = [x, y + 1, z]
      | otherwise = [x, y, z + 1]