module Main where import Data.List main :: IO () main = do { [l] <- getInts ; [n] <- getInts ; ws <- getInts ; print $ length $ unfoldr phi (l,sort ws) } phi :: (Int,[Int]) -> Maybe ((),(Int,[Int])) phi (_,[]) = Nothing phi (0,_) = Nothing phi (x,y:ys) | x < y = Nothing | otherwise = Just ((),(x-y,ys)) getInts :: IO [Int] getInts = map read . words <$> getLine