n=int(eval(input()))

a=int(eval(input()))

b=int(eval(input()))

c=int(eval(input()))

d=int(eval(input()))

e=int(eval(input()))

m = min(a,b,c,d,e)

cnt = (n-1)//m + 1

print((cnt+4))
n = int(eval(input()))

m = min([int(eval(input())) for _ in range(5)])

cnt = (n-1)//m + 1

print((cnt + 4))

n = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
d = int(eval(input()))
e = int(eval(input()))
m = min(a, b, c, d, e)
cnt = (n - 1) // m + 1
print((cnt + 4))

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

-a = int(eval(input())) -b = int(eval(input())) -c = int(eval(input())) -d = int(eval(input())) -e = int(eval(input())) -m = min(a, b, c, d, e) +m = min([int(eval(input())) for _ in range(5)])