import Control.Monad

solver n a b c d e = let (r,q) = divMod n (minimum [a,b,c,d,e]) in
                     (if q == 0 then 0 else 1)+ 4 + r

main::IO()
main=do
    (n:a:b:c:d:e:[])<-forM [1..6] (\_-> return.read=<<getLine)
    print (solver n a b c d e)
