### BUGGY CODE ###

N = int(input())                                                                                                                                             
CN = 6                                                                                                                                                       
                                                                                                                                                             
TC = [0] * (CN-1)                                                                                                                                            
for i in range(CN-1):                                                                                                                                        
    TC[i] = int(input())                                                                                                                                     
                                                                                                                                                             
C = [0] * CN                                                                                                                                                 
C[0] = N                                                                                                                                                     
                                                                                                                                                             
time = 0                                                                                                                                                     
                                                                                                                                                             
while C[-1] < N:                                                                                                                                             
    time = time + 1                                                                                                                                          
    for i in range(CN-2,-1,-1):                                                                                                                              
        mc = min(C[i], TC[i])                                                                                                                                
        C[i] = C[i] - mc                                                                                                                                     
        C[i+1] = C[i+1] + mc                                                                                                                                 
                                                                                                                                                             
print(time) 

### FIXED CODE ###

import math                                                                                                                                                  
                                                                                                                                                             
N = int(input())                                                                                                                                             
CN = 6                                                                                                                                                       
                                                                                                                                                             
TC = [0] * (CN-1)                                                                                                                                            
for i in range(CN-1):                                                                                                                                        
    TC[i] = int(input())                                                                                                                                     
                                                                                                                                                             
                                                                                                                                                             
time = CN - 1                                                                                                                                                
                                                                                                                                                             
min_TC = min(TC)                                                                                                                                             
print(4+ math.ceil(N/min_TC))