fun main(args: Array<String>) {
	val n = (readLine() ?: return).toLong()
	val input = LongArray(5) { (readLine() ?: return).toLong() }

	var time = n / input[0] + if (n % input[0] > 0) 1 else 0
	var min = input[0]
	for (i in 1 until 5) {
		if (input[i] > min) {
			time++
			continue
		}
		min = input[i]
		val rest = n - input[i] * (time - i)
		time += rest / input[i] + if (rest % input[i] > 0) 1 else 0
	}
	println(time)
}