n=int(eval(input()))

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

print(((n+min(l)-1)//min(l)+4))
n=int(eval(input()))

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

print(((n+x-1)//x+4))
n = int(eval(input()))
l = [int(eval(input())) for i in range(5)]
print(((n + min(l) - 1) // min(l) + 4))

n = int(eval(input()))
x = min([int(eval(input())) for i in range(5)])
print(((n + x - 1) // x + 4))

-l = [int(eval(input())) for i in range(5)] -print(((n + min(l) - 1) // min(l) + 4)) +x = min([int(eval(input())) for i in range(5)]) +print(((n + x - 1) // x + 4))