program main
	implicit none
	integer(8) :: N, a(1:5), ans
	integer :: i, temp
	read(*, *) N
	do i = 1, 5
		read(*, *) a(i)
	end do
	
	temp = 1
	do i = 2, 5
		if(a(temp) > a(i)) then
			temp = i
		end if
	end do
	ans = 4
	if(mod(N, a(temp)) == 0) then
		ans = ans + N
	else
		ans = ans + N/a(temp) + 1
	end if
	

	write(*, *) ans 

end program main