import java.util.Scanner

object Main {
  def main(args: Array[String]) {
    val result = solve(new Scanner(System.in))
    if (result.length > 0) println(result)
  }

  def solve(in: String): String = solve(new Scanner(in))

  def solve(sc: Scanner): String = {
    val N = sc.nextLong
    val ABCDE = Array.fill(5)(sc.nextInt)

    val min = ABCDE.min
    val minIdx = ABCDE.indexOf(min)
    val a = ((N + (min - 1)) / min) + (4 - minIdx) + minIdx
    a.toString
  }
}
