Problem: In 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!  There are five means of transport in this empire:    * Train: travels from City 1 to 2 in one minute. A train can occupy at most A people.   * Bus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.   * Taxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.   * Airplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.   * Ship: travels from City 5 to 6 in one minute. A ship can occupy at most E people.  For each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).  There is a group of N people at City 1, and they all want to go to City 6.   At least how long does it take for all of them to reach there? You can ignore the time needed to transfer.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import copy
import math


n = int(input())

capa = []

capa=[int(input()) for i in range(5)]


capa_min = min(capa)

ans = math.floor(n/capa_min) + 5
amari = n % capa_min


if amari != 0:
    
    
    capa.sort(reverse = True)
    for i in range(len(capa)):
        ans += math.floor(amari / capa[i]) + i
        if amari % capa[i] == 0:
            # ans += i
            break

print (str(ans))






# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1

#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))

#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))


# -*- coding: utf-8 -*-
import copy
import math


n = int(input())

capa = []

capa=[int(input()) for i in range(5)]


capa_min = min(capa)

ans = n//capa_min 

# if n <= capa_min:
#     amari = 0
# else:
amari = n % capa_min


if amari != 0:
    ans += 5
else:
    ans += 4
    
print (str(ans))






# time = 0

# while toshi[5] != n:
#     # print("toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(toshi[0],toshi[1],toshi[2],toshi[3],toshi[4],toshi[5]))
#     time += 1

#         if toshi[i] != 0:
#             if toshi[i] > capa[i]:
#                 next_toshi[i] = next_toshi[i] - capa[i]
#                 next_toshi[i+1] = toshi[i+1]  + capa[i]
#             else:
#                 next_toshi[i] = next_toshi[i] - toshi[i]
#                 next_toshi[i+1] = toshi[i+1] + toshi[i] 
#         # print("toshi[{}]:{},toshi[{}]:{}".format(i,next_toshi[i],i+1,next_toshi[i+1]))

#     # print("next_toshi[0]:{},[1]:{},[2]:{},[3]:{},[4]:{},[5]:{}".format(next_toshi[0],next_toshi[1],next_toshi[2],next_toshi[3],next_toshi[4],next_toshi[5]))
        
# print(str(time))


Verdicts: Wrong Answer

Accepted