program main
  implicit none
  integer(8) :: N
  integer(8) :: A(5)
  integer(8) :: Amin
  integer(8) :: out
  integer :: mind(1)
  integer :: i
  
  read(*,*) N
  do i = 1,5
     read(*,*) A(i)
  end do
  Amin = minval( A )
  if ( Amin /=1 ) then
     out = N/Amin +5
  else if (Amin == 1 .and. N /= 1) then
     out = N/Amin -1 +5
  else 
     out = 5
  end if
  write(*,'(i0)') out
  stop
end program main
