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):
N = int(input())
a = []
for i in range(5):
    a.append(int(input()))

num_ride = min(a)
num_arrive = 5-a.index(num_ride)
if num_ride < N:
    if 10 * N/num_ride % 10 == 0:
        
        print(5+int(N/num_ride)-1)
    else:
       print(5+int(N/num_ride))

else:
     print(5)

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

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

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

k = li.index(min(li))
if n%li[k] == 0:
  print(n//li[k] + 4)
else:
  print(n//li[k] + 5)

Solution (Python):
a = [int(input()) for _ in range(6)]
n = a.pop(0)
b = min(a)
print((n-1)//b+5)

Solution (Python):
import math

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

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

Solution (Python):
import math

n = int(input())

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

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

print(4 + math.ceil(n / bn))

Solution (Python):

N = int(input())
min_cap = min([int(input()) for i in range(5)])
print(-(-N//min_cap)+4)

Solution (Python):
n=int(input())
tr=[]
for i in range(5):
  tr.append(int(input()))
if n%min(tr)!=0:
  print(5+(n//min(tr)))
else:
  print(4+(n//min(tr)))

Solution (Python):
N = int(input())
capacity = [int(input()) for i in range(5)]
min = min(capacity)
count = N // min

if N % min == 0:
    print(5+count-1)
else:
    print(5+count)

Solution (Python):
N, *C = [int(input()) for _ in range(6)]

print(4 + (N // min(C)) + (0 != N % min(C)))

Solution (Python):
n=int(input())
time=[]
  
for i in range(5):
  time.append(int(input()))
  
times,modul=n//min(time),n%min(time)

if modul == 0:
  print(times+5-1)
else:
  print(times+5)

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

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

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

print(math.ceil(N / minimum) + 4)

Solution (Python):
import sys

input = sys.stdin.readline

input_tmp = [int(input()) for _ in range(6)]

n = input_tmp[0]

a2e = input_tmp[1:]

min_value = min(a2e)

if n <= min_value:
    print(5)
else:
    if n % min_value != 0:
        print(n // min_value + 5)
    else:
        print(n // min_value - 1 + 5)

Solution (Python):
n = int(input())
a = [int(input()) for i in range(5)]
t = 0
b = 0
for i in range(5):
    if a[i] == min(a) and a[i] != b:
        if n % a[i] == 0:
            t = t + n//a[i]
        else:
            t = t + n//a[i] + 1
        b = a[i]
    else:
        t = t + 1
print(t)

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):
n = int(input())
h = [int(input()) for _ in range(5)]
mins = min(h)
ppm = -(-n//mins)
print(ppm+4)

Solution (Python):
import math

N = int(input())

min_ = int(input())
for i in range(4):
    min_ = min(min_, int(input()))

print(math.ceil(N/min_)+4)

Solution (Python):

n1 = int(input())
na1 = []

for i1 in range(5):
    na1.append(int(input()))

n2 = min(na1)

r1 = n1 // n2

if n1 % n2 == 0 and n1 // n2 != 0:
    r1 -= 1

r1 += 5
print(r1)

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

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

Solution (Python):


import math

if __name__ == '__main__':
    n = int(input())
    b = [int(input()) for _ in range(5)]

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

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

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

m = min(abcde)
group = N//m if N%m==0 else N//m+1
print(5 + group - 1)

Solution (Python):
import sys
import math

input = sys.stdin.readline

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(4+max(math.ceil(n/a), math.ceil(n/b), math.ceil(n/c), math.ceil(n/d), math.ceil(n/e)))

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

Solution (Python):
n=int(input())
t=[int(input()) for i in range(5)]
m=min(t)
if n%m==0:
    a=n//m+4
else:
    a=n//m+5
print(a)

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

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

Solution (Python):
N = int(input())
lowest = float("inf")
for i in range(5):
    lowest = min(lowest, int(input()))


print(-(-N // lowest) + 4)

Solution (Python):
N = int(input())
nums = [int(input()) for i in range(5)]
groups = 0
if N % min(nums) == 0:
    groups = N // min(nums) - 1
else:
    groups = N // min(nums)
print(groups + 5)

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

capacities = []
for i in range(0, 5):
    x = int(input())
    capacities.append(x)

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

Solution (Python):

import math

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

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

print(ans)

Solution (Python):

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

ans = 4 + ((n - 1) // min(trans) + 1)

print(ans)

Solution (Python):
n = int(input())
l = [int(input()) for i in range(5)]
r = min(l)
h = -(-n//r)
print(4+h)

Solution (Python):










import numpy as np
import math
import copy

N = int(input())

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

trans_min = min(l)

bottle_neck = math.ceil(N / trans_min)

print(bottle_neck + 4)

Solution (Python):
n=int(input())
l=[int(input()) for i in range(5)]
min_l=min(l)
if n%min_l==0:
  t=int(n/min_l)+4
else:
  t=int(n/min_l)+5
print(t)

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

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

    speed = min([A, B, C, D, E])
    waittime = (N // speed) if N % speed == 0 else (N // speed) + 1
    return waittime + 4

if '__main__' == __name__:
    print(resolve())

Solution (Python):






N = int(input())
A = [int(input()) for i in range(5)]
"""
10000000007
2
3
5
7
11
"""





ma = min(A)
if ma == 1:
    print(N//ma+4)
else:
    print(N//ma+5)












"""
time = 0
while max(ppl[:5]) > 0:
    tmppl = ppl.copy()
    for i in range(len(A)):
        mina = A[i] if ppl[i]>=A[i] else ppl[i]
        tmppl[i] -= mina
        tmppl[i+1] += mina
    ppl = tmppl
    time += 1
    
"""

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

Bottoleneck=min(L)

if N%Bottoleneck==0:
    ans=4+N//Bottoleneck
else:
    ans=5+(N//Bottoleneck)

print(ans)

Solution (Python):
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
t = [a, b, c, d, e]
m = min(t)
print(math.ceil(n/m)+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())
bottleneck = min([A,B,C,D,E])
print(ceil(N/bottleneck) + 4)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=[I() for _ in range(5)]

  for i in range(len(l)):
    if l[i]==min(l):
      return -(-n//l[i])+len(l)-1

print(main())

Solution (Python):
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
time = 0
lists = [A,B,C,D,E]
MinMove = min(lists)
ans = math.ceil(N / MinMove) + 4
print(ans)

Solution (Python):


import math
N = int(input())
ABCDE = [int(input()) for i in range(5)]
print(math.ceil(N/min(ABCDE)) + 4)

Solution (Python):
from math import ceil


def main():
    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])
    print(5 + ceil(N / min_)-1)


if __name__ == "__main__":
    main()

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

s = []
for i in range(1, 6):
    s.append(inputstr1[i])
ss = sorted(s)

if ss[0] == 1:
    maxtime = inputstr1[0] // ss[0] - 1
elif inputstr1[0] > ss[0]:
    maxtime = inputstr1[0] // ss[0]
else:
    maxtime = 0
print(maxtime + 5)

Solution (Python):
from math import ceil

N = int(input())
C = [int(input()) for _ in range(5)]
c = min(C)

print(ceil(N / c) + 4)

Solution (Python):

from math import ceil
cnd = list(map(int, [input().rstrip() for _ in range(6)]))
print(ceil(cnd[0] / min(cnd[1:])) + 4)

Solution (Python):

from math import ceil
cnd = list(map(int, [input().rstrip() for _ in range(6)]))
print(ceil(cnd[0] / min(cnd[1:])) + 4)

Solution (Python):
n = int(input())
pTrans = []
for _ in range(5):
        a = int(input())
        pTrans.append(a)
if n < min(pTrans) :
        print('5')
elif n%min(pTrans) == 0 :
        print(n//min(pTrans) + 4)
else :
        print(n//min(pTrans) + 5)

Solution (Python):
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)


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

min_num = a[0]

for i in a:
	if i < min_num:
		min_num = i
		
ans = -(-N // min_num) + 4
print(ans)

Solution (Python):
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((F+N-1)//F+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())

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

Solution (Python):
n = int(input())
a = min(int(input()) for i in range(5))
print(-(-n//a)+4)

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

Solution (Python):
n = int(input())
a = [int(input()) for i in range(5)]
print(n//min(a)+4 if min(a) == 1 else n//min(a)+5)

Solution (Python):
n = int(input())
a = [int(input()) for i in range(5)]
print(n//min(a)+4 if min(a)==1 else n//min(a)+5)

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

Solution (Python):
num = []
n = int(input())
for i in range(5):
    num.append(int(input()))
a = min(num)
t = n // a
if (n % a != 0):
    t += 5
else:
    t += 4
print(t)

Solution (Python):
print(-(-int(input()) // min([int(input()) for i in range(5)])) + 4)

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






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

Solution (Python):
import math

N = int(input())

a = []

for _ in range(5):
    aa = int(input())
    a.append(aa)

X = min(a)

print( math.ceil(N/X) + 4)

Solution (Python):
n=int(input())
a=[int(input()) for _ in range(5)]
mi=min(a)
print(n//mi+int(bool(n%mi)) +4)

Solution (Python):
num = []
n = int(input())
for i in range(5):
  num.append(int(input()))
a = min(num)
t = n // a
if(n % a != 0):
  t += 5
else:
  t += 4
print(t)

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

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

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

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

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

lst_A = []

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

lst_A.sort()

ans = N // lst_A[0]

if N % lst_A[0]:

    ans += 1

ans += 4

print(ans)

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

Solution (Python):
import sys
import os


N=int(input())
p=[0]*5
for i in range(5):
    p[i]=int(input())

pmin=min(p)

g=int(N/pmin)
if (N%pmin)==0:
    print(5+g-1)
else:
    print(5+g)

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

min_velosity = min(A)

print(math.ceil(N/min_velosity)+4)

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

Solution (Python):
n,a,b,c,d,e = [int(input()) for i in range(6)]
m = min(a,b,c,d,e)
if n % m == 0:
  print(n//m + 4)
else:
  print(n//m + 5)

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

Solution (Python):


import math

II = lambda: int(input())


def main():
    N = II()
    return max(map(lambda p: math.ceil(N/p), [II() for _ in range(5)])) + 4


if __name__ == "__main__":
    print(main())

Solution (Python):


import math

II = lambda: int(input())


def main():
    N = II()
    return max(map(lambda p: math.ceil(N/p), [II() for _ in range(5)])) + 4


if __name__ == "__main__":
    print(main())

Solution (Python):
N, *x = map(int, open(0))
print(5 + ((N - 1) // min(x)))

Solution (Python):
N, *x = map(int, open(0))
print(4 - (-N // min(x)))

Solution (Python):
import math
n = int(input())
a = []
lowest = 10**15
for i in range(5):
    a.append(int(input()))
    lowest = min(lowest, a[i])

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

print(ans)

Solution (Python):
import math
N=int(input())
l=list(int(input()) for _ in range(5))
if N<=min(l):
    print(5)
else:
    print(math.ceil(N/min(l))-1+5)

Solution (Python):
import sys


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

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



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


def main():
    N = int(input())
    C = []
    for _ in range(5):
        C.append(int(input()))

    print(4 + ceil(N, min(C)))


if __name__ == '__main__':
    main()

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

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

ans=-(-n//m[0])
print(ans+4)

Solution (Python):
import math

def main():
    n = int(input())
    a = [int(input()) for i in range(5)]
    min_move = min(a)
    print(math.ceil(n/min_move)+4)

if __name__ == '__main__':
    main()

Solution (Python):
N =int(input())
l = [int(input()) for _ in range(5)]
l.sort()
ans = 4 + (N+l[0]-1)//l[0]
print(ans)

Solution (Python):
import math

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


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



groups = math.ceil(N / neck)

if groups <= 1:
    ans = 5
else:
    ans = 5 + (groups - 1)
    
print(ans)

Solution (Python):
def get_input():
    N = int(raw_input())
    A = int(raw_input())
    B = int(raw_input())
    C = int(raw_input())
    D = int(raw_input())
    E = int(raw_input())
    return N, A, B, C, D, E

def solve2():
    N, A, B, C, D, E = get_input()
    X = min(A, B, C, D, E)
    NdivX = (N  + X - 1) / X
    ret = 5 + NdivX - 1
    print ret

if __name__ == '__main__':
    solve2()

Solution (Python):



import sys
import math

input = sys.stdin.readline

def main():
    n = int(input())
    a, b, c, d, e = [int(input()) for _ in range(5)]
    print(math.ceil(n / min(a, b, c, d, e)) + 4)

main()

Solution (Python):
num = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
split_num = min(a,b,c,d,e)
extra = 0
if num % split_num != 0:
	extra = 1
print(int(num / split_num) + extra + 4)

Solution (Python):
import math
from collections import deque

N = int(input())
X = deque()
for i in range(5):
        X.append(int(input()))
m = min(X)
print(math.ceil(N/m)+4)

Solution (Python):
trans = []
for i in range(6):
    trans.append(int(input()))

delay = 0
bottle_neck = trans[0]
for i in range(1,6):
    if bottle_neck > trans[i]:
        delay += int(trans[0] / trans[i]) - 1 - delay
        if trans[0]%trans[i] != 0:
            delay += 1
        bottle_neck = trans[i]

print(delay+5)

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

import math
print(math.ceil(N / min(map(int, list(abcde))) + 4))

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

b = min(l)
if b >= n:
    print(5)
else:
    t = (n - b) // b
    if (n -b) % b != 0:
        t += 1
    print(t + 5)

Solution (Python):
import sys
def II(): return int(sys.stdin.readline())

N = II()
li = []
for i in range(5):
    li.append(II())

import math
print(math.ceil(N/min(li))+4)

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)
ans = (n-1)//min + 5

print(ans)

Solution (Python):
from math import ceil
min_capacity = 10**16

N = int(input())
for i in range(5):
    x = int(input())
    min_capacity = min(min_capacity,x)
print(ceil(N/min_capacity)+4)

Solution (Python):
N=int(input())
A,B,C,D,E=[int(input()) for i in range(5)]
bn=min(A,B,C,D,E)
if N%bn==0:
    m=N//bn-1
else:
    m=N//bn
print(5+m)

Solution (Python):
n = int(input())
l = []
for i in range(5):
    l.append(int(input()))
k = (n%min(l)==0 and n//min(l)) or (n//min(l)+1)
print(k+4)

Solution (Python):

N=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
import math
print(math.ceil(N/min(a))+4)

Solution (Python):
n = int(input())
transport = [int(input()) for x in range(0,5)]

trans_min_index = transport.index(min(transport))
if transport[trans_min_index] == 1 :
    time = 5-1 + int(n/transport[trans_min_index])
else:
    time = 5-1 + int(n/transport[trans_min_index] + 1)

print(time)

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

Solution (Python):
c = [0] * 6
data = [0] * 6
for i in range(6):
    data[i] = input()

n, a, b, C, d, e = list(map(int, data))

if n % min(a,b,C,d,e) != 0:
    score = (n // min(a,b,C,d,e)) + 1
else:
    score = n / min(a,b,C,d,e)
ans =int( score +4)
print(ans)

"""
c[0] = n
count = 0
print(n,a,b,C,d,e)
tem = [0] * 6
while c[5] != n:
    count += 1
    print(c)
    if c[0] == 0:
        pass
    elif c[0] <= a:
        tem[1] += c[0]
        c[0] = 0
    else:
        c[0] -= a
        tem[1] += a

    if c[1] == 0:
        pass
    elif c[1] <= b:
        tem[2] += c[1]

    else:
        c[1] -= b
        tem[2] += b

    if c[2] == 0:
        pass
    elif c[2] <= C:
        tem[3] += c[2]
        c[2] = 0
    else:
        c[2] -= C
        tem[3] += C
    
    if c[3] == 0:
        pass
    elif c[3] <= d:
        tem[4] += c[3]
        c[3] = 0
    else:
        c[3] -= d
        tem[4] += d

    if c[4] == 0:
        pass
    elif c[4] <= e:
        tem[5] += c[4]
        c[4] = 0
    else:
        c[4] -= e
        tem[5] += e
    for i in range(1,6):
        c[i] += tem[i]
        tem[i] = 0
    
print(count)
"""

Solution (Python):
import math

N, A, B, C, D, E = map(int, [int(input()) for i in range(6)])
MIN = min(A,B,C,D,E)
print(4+math.ceil(N/MIN))

Solution (Python):

import math 

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

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)
print(math.ceil(n/m) + 4)

Solution (Python):
def sub():
    items = [int(input()) for _ in range(6)]
    N = int(items[0])
    ds = [int(e) for e in items[1:]]
    k = min(ds)
    
    nb_pack, m = divmod(N, k)
    if m != 0:
        nb_pack = nb_pack + 1
    wait = nb_pack - 1 + 5
    print(wait)

sub()

Solution (Python):
n = int(input())
l = []
for i in range(5): l.append(int(input()))
print((n // min(l) + 4) + (n % min(l) != 0))

Solution (Python):
from sys import stdin
from math import ceil


    
    
    
    
    

    
    
        
        
        
            
            
            
            
        
    


def solve(nums):
    num_person, *caps = nums
    return 4 + ceil(num_person / min(*caps))


def main():
    nums = [int(l) for l in stdin.readlines()]
    ans = solve(nums)
    print(ans)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import math

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

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

suf = 1 if N%min_ != 0 else 0
print(N//min_+4+suf)

Solution (Python):
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)
if N%X == 0:
    print(N//X + 4)
else:
    print(N//X + 5)

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


m = min(n)

if t < m:
    t = m

tmp = t//m

if t % m != 0:
    tmp += 1

print(tmp+4)

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

Solution (Python):
import math                                                                                                                                                  
                                                                                                                                                             
N = int(input())                                                                                                                                             
CN = 6                                                                                                                                                       
                                                                                                                                                             
TC = [0] * (CN-1)                                                                                                                                            
for i in range(CN-1):                                                                                                                                        
    TC[i] = int(input())                                                                                                                                     
                                                                                                                                                             
                                                                                                                                                             
time = CN - 1                                                                                                                                                
                                                                                                                                                             
min_TC = min(TC)                                                                                                                                             
print(4+ math.ceil(N/min_TC))

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

if min(S) >= N:
  print(5)
else:
  if N % min(S) == 0:
    print(int(N//min(S)) + 4 )
  else:
    print(int(N//min(S)) + 5 )

Solution (Python):
n = int(input())
min_num = min(int(input()) for _ in range(5))

print((n-1)//min_num + 5)

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

a = min(x)
if a >= N:
	print(5)
else:
	if N % a == 0:
		print(int(N // a) + 4)
	else:
		print(int(N // a) + 5)

Solution (Python):
N=int(input())
M=min(int(input()) for _ in [0]*5)
print((N+M-1)//M+4)

Solution (Python):
N=int(input())
M=min(int(input()) for _ in [0]*5)
print(N//M+(5 if N%M else 4))

Solution (Python):
N,A,B,C,D,E =[int(input()) for _ in [0]*6]
M = min(A,B,C,D,E)
print(N//M+ (5 if N%M else 4))

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

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

print(math.ceil(N/a)+4)

Solution (Python):
import math

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

transport = [A, B, C, D, E]
bottleneck = min(transport)
time = 0
reached = 0

time = math.ceil(N / bottleneck) + 4

print(time)

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

row=[a,b,c,d,e]

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

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

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

Solution (Python):

"""
C - Five Transportations
https://atcoder.jp/contests/abc123/tasks/abc123_c

"""
import sys

from math import ceil

def solve(N, passengers):
    passengers.insert(0, 0)
    res = [-1] * 7
    res[0], res[1] = 0, 0
    res[2] = ceil(N / passengers[1])
    for i in range(3, 7):
        if passengers[i-1] >= passengers[i-2]:
            res[i] = res[i-1] + 1
        else:
            res[i] = max((i-2) + ceil(N / passengers[i-1]), res[i-1] + 1)
    return res[-1]


def main(args):
    N = int(input())
    passengers = [int(input()) for _ in range(5)]
    ans = solve(N, passengers)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

m = min(a)
if n % m  != 0:
    ans = n // m + 5
else:
    ans = n // m + 4
print(ans)

Solution (Python):

"""
Created on Mon May 13 13:29:57 2019

@author: avina
"""

n= int(input())
l = []
for i in range(5):
    l.append(int(input()))
k = min(l)
o = l.index(k)
sums = 4
if n%k != 0:
    sums+= n//k + 1
else:
    sums+= n//k

print(sums )

Solution (Python):
import math


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

Solution (Python):
import math


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

Solution (Python):
from math import ceil

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

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

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

index = 0
v = l[0]
for i in range(len(l)):
    if l[i] < v:
        index = i
        v = l[i]

result = index + n // v + len(l) - index
if (n % v == 0):
    result -=1
print(result)

Solution (Python):
from math import ceil










n=int(input())
X=[]
for _ in range(5):
    X.append(int(input()))

print(5 + ceil(n / min(X)) - 1)

Solution (Python):
def count(inA, inB, before, total):
  if inB >= inA:
    count = before
  else:
    if inA%inB==0:
      count = int(total / inB)
    else:
      count = int(total / inB) + 1
  
  return count

num = []
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))
num.append(int(input()))

total_count = 0
for i in range(0, len(num)-1):
  if i==0:
    total_count = count(num[0], num[i+1], 1, num[0])
  else:
    total_count = count(min(num[1:i+1]), num[i+1], total_count, num[0])

print(total_count + 4)

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):
import math
N = int(input())
r = [int(input()) for _ in range(5)]

m_r = min(r)
print(math.ceil(N/m_r) + 4)

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())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
trafic = [a, b, c, d, e]
ans = 5

if min(trafic) >= n:
    print(ans)
    exit()
else:
    if n % min(trafic) == 0:
        group = n//min(trafic) - 1
    else:
        group = n//min(trafic)

print(ans+group)

Solution (Python):
print((int(input())-1)//min(int(input())for _ in range(5))+5)