main :: IO ()
main = do
  n <- read <$> getLine :: IO Integer
  cs <- sequence . replicate 5 $ read <$> getLine :: IO [Integer]
  let
    m = minimum cs
    (k, l) = n `divMod` m
    k' = if l == 0 then k else succ k
  print $ pred k' + 5
