N = gets.to_i
A = gets.to_i
B = gets.to_i
C = gets.to_i
D = gets.to_i
E = gets.to_i
time_list = [A,B,C,D,E]
min = time_list.min
min_index = time_list.index(min)
puts (N/min) + (N%min==0 ? 0 : 1) + 4-min_index + min_index