Problem:
 Score: 300 points    Problem Statement  In 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6 )!  There are five means of transport in this empire:   Train: travels from City 1 to 2 in one minute. A train can occupy at most A people.  Bus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.  Taxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.  Airplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.  Ship: travels from City 5 to 6 in one minute. A ship can occupy at most E people.   For each of them, one vehicle leaves the city at each integer time (time 0 , 1 , 2 , ... ).  There is a group of N people at City 1 , and they all want to go to City 6 . At least how long does it take for all of them to reach there? 
You can ignore the time needed to transfer.      Constraints   1 \leq N, A, B, C, D, E \leq 10^{15}  All values in input are integers.         Input  Input is given from Standard Input in the following format:  N  A  B  C  D  E       Output  Print the minimum time required for all of the people to reach City 6 , in minutes.        Sample Input 1 5
3
2
4
3
5      Sample Output 1 7  One possible way to travel is as follows.
First, there are N = 5 people at City 1 , as shown in the following image:   In the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.   In the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.   In the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.   From then on, if they continue traveling without stopping until they reach City 6 , all of them can reach there in seven minutes. There is no way for them to reach City 6 in 6 minutes or less.       Sample Input 2 10
123
123
123
123
123      Sample Output 2 5  All kinds of vehicles can occupy N = 10 people at a time.
Thus, if they continue traveling without stopping until they reach City 6 , all of them can reach there in five minutes.       Sample Input 3 10000000007
2
3
5
7
11      Sample Output 3 5000000008  Note that the input or output may not fit into a 32 -bit integer type.

Solution (Python):
from math import ceil
N=int(input())
A=[int(input()) for i in range(5)]
print(5+ceil(N/min(A)-1))

Solution (Python):
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

print(math.ceil(N/min(A,B,C,D,E))+4)

Solution (Python):
from math import ceil
n, a, b, c, d, e = [int(input()) for _ in range(6)]
neck = min(a, b, c, d, e)
ans = ceil(n / neck) + 4
print(int(ans))

Solution (Python):
import math
n=int(input())
a=[int(input()) for _ in range(5)]
print(math.ceil(n/min(a))+4)

Solution (Python):
N, *A = map(int, open(0).read().split())

bottleneck = min(A)

import math
print(math.ceil(N / bottleneck) + 4)

Solution (Python):
import math

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

abcde = [A, B, C, D, E]

print(4 + math.ceil(N / min(abcde)))

Solution (Python):
import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
ans=4
time=[a,b,c,d,e]
x=min(n,min(time))
print(ans+math.ceil(n/x))

Solution (Python):

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

t = [a,b,c,d,e]
t.sort()

if n % t[0] == 0:
    p = n // t[0]
else:
    p = n // t[0] + 1
    
print(4+p)

Solution (Python):
import math
N = int(input())
S = [int(input()) for _ in range(5)]

print(math.ceil(N/min(S))+4)

Solution (Python):
def main():
    N = int(input())
    num = [int(input()) for _ in range(5)]
    num.sort()
    temp = 0
    temp = N // num[0]
    if N%num[0] == 0:
        ans = temp
    else:
        ans = temp + 1

    ans += 4
    return ans

print(main())

Solution (Python):
n = int(input())
ls = [int(input()) for _ in range(5)]
k = n//min(ls)
if (n/min(ls)) % 1 != 0:
    k += 1
print(k+4)

Solution (Python):
n = int(input())
p = []
for _ in range(5):
    p.append(int(input()))
m = min(p)
idx = p.index(m)
ans = (idx - 1) + n // m + (5 - idx)
if n % m:
    ans += 1
print(ans)

Solution (Python):
import math

N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

m = min(a, b, c, d, e)
ans = math.ceil(N / m) + 4

print(ans)

Solution (Python):
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(4+math.ceil(n/min(a,b,c,d,e)))

Solution (Python):
import math

n = int(input())
lis = []
for _ in range(5):
    lis.append(int(input()))
    
print(math.ceil(n/min(lis)+4))

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

L = [A, B, C, D, E]

minL = min(L)
print((N+minL-1)//minL + 4)

Solution (Python):
import sys
input = sys.stdin.readline
from math import ceil
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

X = min([A, B, C, D, E])
ans = ceil(N/X) + 4
print(ans)

Solution (Python):
N = int(input())
A = [int(input()) for i in range(5)]
m = min(A)
cnt = (N - 1) // m + 1
print(cnt + 4)

Solution (Python):
import math
n=int(input())
a=list(int(input()) for _ in range(5))
print(math.ceil(n/min(a))+4)

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

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

if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 4 + 1)

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

print(-(-n//min(a,b,c,d,e))+4)

Solution (Python):
import math

N=int(input())
arr=[int(input()) for i in range(5)]
mm=arr.index(min(arr))


time=4+math.ceil(N/arr[mm])

print(time)

Solution (Python):
import math

def main():
    n = int(input())             
    a = [int(input()) for _ in range(5)]
    m = min(a)
    print(math.ceil(n/m) + 4)
    
    
if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
limit = min(a,b,c,d,e)
r,q = divmod(n, limit)

print(5+r+min(q,1)-1)

Solution (Python):
N = int(input())
cost = [int(input()) for i in range(5)]

minc = min(cost)

print((N-1)//minc + 5)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())

    X = min(A, B, C, D, E)
    q, r, = divmod(N, X)
    num = q + int(r > 0)

    ans = 5 + (num - 1)
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
MIN = min(A,B,C,D,E)
d,m = divmod(N,MIN)
if m == 0:
    d -= 1
print(5+d)

Solution (Python):
import math
N = int(input())
ABCDE = []
for _ in range(5):
    i = int(input())
    ABCDE.append(i)

X = min(ABCDE)


group = math.ceil(N/X)


ans = (group-1) + 5
print(ans)

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

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

import math

point = 4

point += math.ceil(n/m)

print(point)

Solution (Python):
import math
def main():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    cost = [A, B, C, D, E]

    f = lambda x : int((N//x))
    t = [f(A), f(B), f(C), f(D), f(E)]

    idx = 0
    ma = 0

    for i in range(len(t)):
        if t[i] > ma:
            ma = t[i]
            idx = i
    ma += idx

    ans = ma + (5 - idx)

    if N % cost[idx] == 0:
        ans -= 1

    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import fractions
import sys
from functools import reduce
import math

input = sys.stdin.readline

def main():
    n = int(input())
    stations = []
    for _ in range(5):
        stations.append(int(input()))
    min_x = min(stations)
    print(5 + math.ceil(n / min_x) - 1)


def divide_list(l, args):
    result = []
    pre = 0
    for i, a in enumerate(args):
        if i != 0:
            pre = args[i-1]
        result.append(l[pre:a])
        if i == len(args) - 1:
            result.append(l[a:])
    return result

def divide_two(n):
    c = 0
    while True:
        if c >= 2:
            break
        if n % 2 != 0:
            break
        n //= 2
        c += 1
    return c

def get_camulative(l):
    import itertools
    
    return [0] + list(itertools.accumulate(l))

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
li = [int(input()) for _ in range(5)]

mn = min(li)
groups = (n + mn - 1) // mn
ans = 5 + groups - 1
print(ans)

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
m = min(A, B, C, D, E)
import math
n = math.ceil(N/m)
ans = n + 4
print(ans)

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(5)]
a = min(A)
n = N//a
k = N%a
ans = 0
if n>0:
    ans = 5+(n-1)
    if k>0:
        ans += 1
else:
    if k>0:
        ans = 5
print(ans)

Solution (Python):
import math
n = int(input())
a = list(int(input()) for _ in range(5))
print(math.ceil((n/min(a)))+4)

Solution (Python):
n = int(input())
L = [int(input()) for _ in range(5)]

ans = 5
if n%min(L) == 0:
    ans += n//min(L)-1
else:
    ans += n//min(L)+1-1
print(ans)

Solution (Python):
from math import ceil

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

print(4+ceil(N/min(A,B,C,D,E)))

Solution (Python):
import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=min(a,min(b,min(c,min(d,e))))
s=math.ceil(n/k)
while s*k<n:
  s+=1
print(5+s-1)

Solution (Python):
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = min([a,b,c,d,e])
print(5 + math.ceil(n/l) - 1)

Solution (Python):
N, A, B, C, D, E = [int(input()) for _ in range(6)]
print (4 + -(-N//min(A,B,C,D,E)))

Solution (Python):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *

from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction



mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]








        




n=l()[0]
a=l()[0]
b=l()[0]
c=l()[0]
d=l()[0]
e=l()[0]
x=min(a,b,c,d,e)
if(x>=n):
    print(5)
else:
    if(n%x!=0):
        n=n+(x-n%x)
    ans=n//x+4
    print(ans)

Solution (Python):
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

x = min(A, B, C, D, E)
ans = math.ceil(N / x) + 4
print(ans)

Solution (Python):
def main():
    N = int(input())
    transportation = [int(input()) for _ in range(5)]

    time = [0] * 5

    for i in range(5):
        if N % transportation[i] == 0:
            time[i] = N // transportation[i]
        else:
            time[i] = N // transportation[i] + 1

    ans = max(time) + 4

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
A = []
for a in range(5):
    b = int(input())
    A.append(b)

A.sort()
if A[0] >= N:
    print(5)
    exit()
else:
    if N % A[0] == 0:
        print(N // A[0] + 4)
        exit()
    else:
        print(N // A[0] + 5)
        exit()

Solution (Python):
import math

N = int(input())
trans = [int(input()) for i in range(5)]
print(math.ceil(N / min(trans)) - 1 + 5)

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())


mi = min(A, B, C, D, E)

s = 0 if N % mi == 0 else 1
ans = 5 if mi > N else 4+N//mi+s
print(ans)

Solution (Python):
from math import ceil
n, *cities = [int(input()) for _ in range(6)]

print(ceil(n / min(cities)) + 4)

Solution (Python):
N = int(input())
times = [int(input()) for _ in range(5)]
bottle_neck = min(times)
print((N + bottle_neck - 1) // bottle_neck + 4)

Solution (Python):
import math
n = int(input())
tlist = [int(input()) for _ in range(5)]
s = min(tlist)
print(math.ceil(n/s) + 4)

Solution (Python):
N=int(input())
a=[0,0,0,0,0]
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
print(5+(N-1)//min(a))

Solution (Python):
x = [int(input()) for _ in range(6)]

import math

ans = math.ceil(x[0] / min(x[1:])) + 4
print(ans)

Solution (Python):
import math
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

small=min(A,B,C,D,E)
if small>=N:
    print(5)
else:
    print(4+math.ceil(N/small))

Solution (Python):
l = [int(input()) for _ in range(6)]

m = min(l[1:])

mc = l[0] // m
mr = l[0] % m

if mr != 0:
    mc += 1

print( 4 + mc )

Solution (Python):
n = int(input())
abc = []
res = [0]*5
for i in range(5):
    a = int(input())
    abc.append(a)
    res[i] = -(-n//a)
ans = 4 + max(res)
print(ans)

Solution (Python):
import math

n = int(input())
a = []
for i in range(5):
  a.append(int(input()))
  
mi = min(a)
ans = 5

ans += math.ceil((n-mi)/mi)

print(ans)

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C  = int(input())
D = int(input())
E = int(input())

if(N%min(A,B,C,D,E)!=0):
    ans = N//min(A,B,C,D,E) + 5
else:
    ans = N//min(A,B,C,D,E) + 5 - 1


print(ans)

Solution (Python):
import math
n = int(input())
abcde = [int(input()) for _ in range(5)]
print(4 + math.ceil(n / min(abcde)))

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
A=[]
B=[0,0,0,0,0]
aa=int((n-0.1)//a)+1
ba=int((n-0.1)//b)+1
ca=int((n-0.1)//c)+1
da=int((n-0.1)//d)+1
ea=int((n-0.1)//e)+1
A.extend([aa,ba,ca,da,ea])
for i in range(4):
    for j in range(i+1,5):
        if A[i]<A[j]:
            A[j]=A[j]-A[i]
        else:
            A[j]=0
ans = 5+A[0]+A[1]+A[2]+A[3]+A[4]-1
print(ans)

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


N = INT()
lim = [INT() for _ in range(5)]

print(-(-N//min(lim))+4)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


N, A, B, C, D, E = [INT() for _ in range(6)]

print(-(-N//min(A, B, C, D, E))+4)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


N = INT()
L = [INT() for _ in range(5)]

C = min(L)
l = L.index(C) 
r = 4 - l

print(-(-N//C)+l+r)

Solution (Python):

import sys

def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    from math import ceil
    return ceil(N / min(A, B, C, D, E)) + 4



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    D = int(next(tokens))  
    E = int(next(tokens))  
    print(solve(N, A, B, C, D, E))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    n, *data = map(int, readlines())
    d = [int(i) for i in data]
    mi = min(d)
    if mi > n:
        print(5)
        return
    n = (n+mi-1)//mi
    print(n+4)
if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    n, *data = map(int, readlines())
    d = [int(i) for i in data]
    mi = min(d)
    mx = max(d)
    if mi > n:
        print(5)
        return
    n = (n+mi-1)//mi
    print(n+4)
if __name__ == '__main__':
    main()

Solution (Python):
import math
n = int(input())
abcde = [int(input()) for _ in range(5)]
print(4 + math.ceil(n / min(abcde)))

Solution (Python):
N = int(input())
transportations = [int(input()) for _ in range(5)]

q,r = divmod(N,min(transportations))

if r != 0:
    q += 1

output = q + 4

print(output)

Solution (Python):


n, a, b, c, d, e = [int(input()) for _ in range(6)]


ans = (n-1)//min(a, b, c, d, e)+1 + 4
print(ans)

Solution (Python):
import sys

import math


from collections import deque

from fractions  import gcd

input=sys.stdin.readline
n=int(input())
x=[int(input()) for _ in range(5)]
t=[0]*5
t[0]=math.ceil(n/x[0])
m=x[0]
for i in range(1,5):
    if x[i]>=m:
        t[i]=t[i-1]+1
    else:
        t[i]=i+math.ceil(n/x[i])
        m=x[i]
print(t[-1])

Solution (Python):
import math
n = int(input())
a = [int(input()) for _ in range(5)]
print(math.ceil(n / min(a)) + 4)

Solution (Python):
import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ABCDE = [A, B, C, D, E]
print(-(-N//min(ABCDE)) + 4)

Solution (Python):
N=int(input())
trans=min([int(input()) for _ in range(5)])
ans=(N+(trans-1))//trans+4
print(ans)

Solution (Python):
import math

N = int(input())
minimum = (-1,float('inf'))
for i in range(5):
  capa = int(input())
  if capa < minimum[1]:
    minimum = (i, capa)

print(math.ceil(N/minimum[1])+4)

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
import math
print(4 + math.ceil(n / min(a, b, c, d, e)))

Solution (Python):
n =  int(input())
a = [int(input()) for i in range(5)]
mina = min(a)

repeat = n//mina

if n % mina == 0:
  print(repeat + 4)
else:
  print(repeat + 5)

Solution (Python):
import math

N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

print( math.ceil( N / min(A,B,C,D,E) ) +4 )

Solution (Python):
N = int(input())
A = [int(input())for _ in range(5)]

now = 0
for i, a in enumerate(A):
    now = max((N - 1) // a + 1 + i, now + 1)
print(now)

Solution (Python):
n = int(input())
m = [int(input()) for _ in range(5)]
bottleneck = min(m)
ans = 4 + -(-n // bottleneck)
print(ans)

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
n = ii()
l = []
for i in range(5):
    l.append(ii())

print((n+min(l)-1)//min(l)+4)

Solution (Python):
n,a,b,c,d,e=[int(input()) for _ in range(6)]

if n%min(a,b,c,d,e)==0:
    print(n // min(a,b,c,d,e) + 4)
else:
    print(n // min(a,b,c,d,e) + 5)

Solution (Python):
def resolve():
    N, *AE = [int(input()) for _ in range(6)]
    print(-(-N // min(AE)) + 4)


resolve()

Solution (Python):
import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=min(a,b,c,d,e)
print(math.ceil(n/f+4))

Solution (Python):
import math
n = int(input())
Min = 10000000000000000
for _ in range(5):
	Min = min(int(input()),Min)

ans = 4
ans += math.ceil(n/Min)
print(ans)

Solution (Python):
n = int(input())
L = [int(input()) for _ in range(5)]
print((n + min(L) - 1) // min(L) + 4)

Solution (Python):
from math import ceil
n = int(input())
A = []
for i in range(5):
    A.append(int(input()))
print(ceil(n/min(A))+4)

Solution (Python):
import math

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

print(4+math.ceil(N/min(A,B,C,D,E)))

Solution (Python):
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(4 + math.ceil(n / min(a, b, c, d, e)))

Solution (Python):
import math
a = [int(input()) for _ in range(6)]
print(math.ceil(a[0] / min(a[1:])) + 4)

Solution (Python):
N = int(input())
L = []
for _ in range(5):
    L.append(int(input()))

mn = min(L)
ans = (-(-N//mn)) + 4
print(ans)

Solution (Python):
import math
n=int(input())
a=[int(input()) for i in range(5)]
b=0
for i in range(5):
  b=max(math.ceil(n/a[i]),b)
print(5+b-1)

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
import math

if N%min(A,B,C,D,E) ==0:
  print(5 + N//min(A,B,C,D,E)-1)
else:
  print(5+N//min(A,B,C,D,E))

Solution (Python):

N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

print(-(-N//min(A,B,C,D,E))+4)

Solution (Python):
import math
N = int(input())
A = [int(input()) for _ in range(5)]
print(4+math.ceil(N/min(A)))

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n = n//a
    count += 1
  if a**count == n:
    return count
  else:
    return count+1





N,A,B,C,D,E = ILs(6)

print(-(-N//min(A,B,C,D,E))+4)

Solution (Python):
n=int(input())



a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

mn=min(a,b,c,d,e)
print((n+mn-1)//mn +4)

Solution (Python):
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())


minmove = min([a, b, c, d, e])

ans = math.ceil(n/minmove) + 4

print(ans)

Solution (Python):
N = int(input())
abcde = [int(input()) for _ in range(5)]
mx = min(abcde)
if N % mx == 0:
  ans = 5 + N // mx -1
else:
  ans = 5 + N // mx

print(ans)

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

now = [n,0,0,0,0,0]

from math import ceil









k = ceil(n/ min(a,b,c,d,e)) +4

print(k)

Solution (Python):

N = int(input())

Cap = []
append = Cap.append
for i in range(5):
    append(int(input()))


total = 0
citys = [N] + ([0] * 5)

bottleneck = min(Cap)
print((N + bottleneck - 1) // bottleneck + 4)

Solution (Python):
n,*a=map(int,open(0).read().split())
print(4+(-n//min(a))*-1)

Solution (Python):
import math

n=int(input())
l=[int(input()) for _ in range(5)]
print(math.ceil(n/min(l))+4)

Solution (Python):
from math import ceil

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

m = min(A, B, C, D, E)
ans = ceil(N / m) + 4
print(ans)

Solution (Python):
import math
n,a,b,c,d,e = map(int,open(0).read().split())

print(5+math.ceil(n/min([a,b,c,d,e]))-1)

Solution (Python):
import math

n=int(input())
abc=[int(input()) for _ in range(5)]

print(math.ceil(n/min(abc))+4)

Solution (Python):
n=int(input())

v = []
for i in range(5):
    v.append(int(input()))

print(-(-n//min(v))+4)

Solution (Python):
import math

n = int(input())
a = []
for i in range(5):
    a.append(int(input()))

ans = math.ceil(n / min(a)) + 4
print(ans)

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import fractions
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

N = getN()
A = getArray(5)


neck = min(A)
print((N + neck - 1) // neck + 4)

Solution (Python):
import math

N = int(input().strip())
A = int(input().strip())
B = int(input().strip())
C = int(input().strip())
D = int(input().strip())
E = int(input().strip())

_min = min([A, B, C, D, E])
print(math.ceil(N/_min)+4)

Solution (Python):

import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

_min = min([a,b,c,d,e])
_ans = math.ceil(n/_min)

print(_ans+4)

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(5)]

def solve():
    mi = min(A)
    ans = 4+(N+mi-1)//mi
    return ans
print(solve())

Solution (Python):
import math
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
print(math.ceil(N/min(A,B,C,D,E))+4)

Solution (Python):
from math import ceil

N = int(input())
times = [int(input()) for _ in range(5)]
t = max([ceil(N / time) - 1 for time in times])
print(t + 5)

Solution (Python):
import numpy as np

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())


print(int(np.ceil(N / min(A, B, C, D, E))) + 4)

Solution (Python):
n = int(input())
K = []
for i in range(5):
    K.append(int(input()))
x = min(K)
print((n-1)//x+5)

Solution (Python):
import itertools
import math
import fractions
import functools
import copy
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
original = [a,b,c,d,e]

print(math.ceil(n / min(original))+4)