N = int(input())
max_ = -1
min_flow = float('inf')
for i in range(5):
    x = int(input())
    min_flow = min(min_flow, x)
    q, r = divmod(N, min_flow)
    if r != 0:
        q += 1
    max_ = max(max_, i + q)
print(max_)

17c3c76fb7c0946aff75d21feaca5cf4fc708313
<mask token>

<mask token>
for i in range(5):
    x = int(input())
    min_flow = min(min_flow, x)
    q, r = divmod(N, min_flow)
    if r != 0:
        q += 1
    max_ = max(max_, i + q)
print(max_)

N = int(input())
max_ = -1
min_flow = float('inf')
for i in range(5):
    x = int(input())
    min_flow = min(min_flow, x)
    q, r = divmod(N, min_flow)
    if r != 0:
        q += 1
    max_ = max(max_, i + q)
print(max_)
