import Data.List.Split

import Data.List
import Control.Monad

getLineRepeat :: Int -> IO [String]
getLineRepeat times = replicateM times getLine

div' a b = if r == 0 then d else d + 1
    where
        r = a `mod` b
        d = a `div` b

main = do
    input <- getLineRepeat 6
    let p = read $ head input :: Integer
    let d = map read $ tail input :: [Integer]
    let r = p `div'`(minimum d)
    putStrLn . show $ 4 + r