program ccc
implicit none

integer(16) :: n, m, res
integer(16), dimension(5) :: move

read*, n
read*, move

m=minval(move)
if(mod(n,m)==0) then
res=n/m+4
else
res=n/m+5
end if

write(*,'(i0)') res

end program