main :: IO()
main = do
    n <- readLn
    a <- readLn
    b <- readLn
    c <- readLn
    d <- readLn
    e <- readLn
    print $ moving [n,0,0,0,0] [a,b,c,d,e]

--「各都市の人数」→「交通機関能力」→何日
moving :: [Integer] -> [Integer] -> Integer
moving [h1,h2,h3,h4,h5] [a,b,c,d,e]
    | sum [h1,h2,h3,h4,h5] == 0				= 0 --最終都市以外の人数合計が０なら、あと０分かかる。
    | otherwise								= 1 + moving [h1 - a', h2 + a' - b', h3 + b' - c', h4 + c' - d', h5 + d' - e'] [a,b,c,d,e]
    where a' = min h1 a
          b' = min h2 b
          c' = min h3 c
          d' = min h4 d
          e' = min h5 e

moving ls1 ls2 = 9999999

