n = int(eval(input()))

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

key = 0

if n % min(lis) == 0:key = 1

print((5 + n//min(lis)-key))
n = int(eval(input()))

nu = min([int(eval(input())) for i in range(5)])

print((4 + bool(n%nu) + n//nu))
n = int(eval(input()))
lis = [int(eval(input())) for i in range(5)]
key = 0
if n % min(lis) == 0:
    key = 1
print((5 + n // min(lis) - key))

n = int(eval(input()))
nu = min([int(eval(input())) for i in range(5)])
print((4 + bool(n % nu) + n // nu))

-lis = [int(eval(input())) for i in range(5)] -key = 0 -if n % min(lis) == 0: -    key = 1 -print((5 + n // min(lis) - key)) +nu = min([int(eval(input())) for i in range(5)]) +print((4 + bool(n % nu) + n // nu))