main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  [a,b] <- map read.words <$> getLine :: IO [Int]
  ps <- map read.words <$> getLine :: IO [Int]
  print $ minimum [length $ filter (<= a) ps, length $ filter (\p -> a < p && p <= b) ps, length $ filter (b <) ps]
