import Control.Monad (replicateM)

main :: IO ()
main = do
  (n:ns) <- map (read :: String -> Int) <$> getNLine_ 6
  print $ ans n ns

ans :: Int -> [Int] -> Int
ans n ns = let m = minimum ns in 5 + n `div` m

getNLine_ :: Int -> IO [String]
getNLine_ n = replicateM n getLine