n=int(eval(input()))

m=10**15+1

mi=0

for i in range(5):

  a=int(eval(input()))

  if a<m:

    m=a

    mi=i

print(((n-1)//m+1+5-1))
n=int(eval(input()))

m=10**15+1

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

print(((n-1)//min(a)+5))
n = int(eval(input()))
m = 10**15 + 1
mi = 0
for i in range(5):
    a = int(eval(input()))
    if a < m:
        m = a
        mi = i
print(((n - 1) // m + 1 + 5 - 1))

n = int(eval(input()))
m = 10**15 + 1
a = [int(eval(input())) for _ in range(5)]
print(((n - 1) // min(a) + 5))

-mi = 0 -for i in range(5): -    a = int(eval(input())) -    if a < m: -        m = a -        mi = i -print(((n - 1) // m + 1 + 5 - 1)) +a = [int(eval(input())) for _ in range(5)] +print(((n - 1) // min(a) + 5))