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):
import math

an = []
for i in range(6):
    temp = input()
    an.append(int(temp))

N = an[0]
an.pop(0)

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

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

min_val = int(input())

for i in range(4):
    tmp = int(input())
    if min_val > tmp:
        min_val = tmp

wait = N//min_val
if min_val*wait==N:
    wait -= 1
print(wait+5)

Solution (Python):
n=int(input())
peoplelist=[]
for i in range(5):
  num=int(input())
  peoplelist.append(num)
bottle=min(peoplelist)
bottleindex=peoplelist.index(bottle)
if n<=bottle:
  print(5)
else:
  totaltime=0
  if n%bottle==0:
    totaltime+=int(n/bottle)
  else:
    totaltime+=int(n/bottle)+1
  totaltime+=4
  print(totaltime)

Solution (Python):
A = [0,0,0,0,0]
B = [0,0,0,0,0]
N = int(input())
for i in range(5):
    A[i] = int(input())
    B[i] = -(-N // A[i])
print(max(B)  - 1 + 5)

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

ans = -(-N // min(T))
print(ans+4)

Solution (Python):
import numpy as np
import math
N=int(input())
people_pm=[]
a=int(input())
people_pm.append(a)
b=int(input())
people_pm.append(b)
c=int(input())
people_pm.append(c)
d=int(input())
people_pm.append(d)
e=int(input())
people_pm.append(e)
wait_time = math.ceil(N/min(people_pm))
print(wait_time+4)

Solution (Python):
T = [0] * 5
N = int(input())
for i in range(5):
	t = int(input())
	T[i] = t

if N%min(T) == 0:
	rissoku = N//min(T)-1
else:
	rissoku = N//min(T)

ans = rissoku + 5
print(ans)

Solution (Python):
import math

n = int(input())
a = []
ans = 0
count = [0] * 5
for i in range(5):
    a.append(int(input()))
    count[i] = math.ceil(n / a[i])

for i in range(1, 5):
    if count[i] < count[i - 1]:
        count[i] = count[i - 1]

print(count[4] + 4)

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

print((5 + math.ceil((n - min(trans)) / min(trans)))) if n > min(trans) else print(5)

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

if min(A) >= A[0]:
    print(5)
    sys.exit()
    
B = list(A)
count = math.ceil(A[0]/min(B))-1
print(count+5)

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

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

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

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

Solution (Python):

import copy
import numpy as np
import random
import math
import bisect 

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

traffic_time.sort()

wait_time = math.ceil(n/traffic_time[0])



wait_time -= 1



wait_time = max(wait_time,0)

print(wait_time+5)

Solution (Python):
import math


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

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

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

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


print(m + n//neck if n%neck != 0 else m + n//neck -1)

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

min_num=min(nums)
if min_num==1:
  print(N//min_num+4)
elif min_num==N:
  print(5)
else:
  print(N//min_num+5)

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

method = [int(input())for _ in [0]*5]
min_div = min(method)

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

Solution (Python):
input_lines = input().split()
N = int(input_lines[0])
min_value = 10 ** 15
for i in range(5):
    input_lines = input().split()
    value = int(input_lines[0])
    if value < min_value:
        min_value = value
if min_value != 1:
    print(int(N / min_value) + 5)
else:
    print(int(N / min_value) + 4)

Solution (Python):
N = int(input())
cmin = 10 ** 15 + 1
for i in range(5):
    c = int(input())
    cmin = min(c, cmin, N)

t = 4 + N // cmin
if(N % cmin != 0):
    t += 1
print(t)

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

if n <= min(A):
    print(5)
elif n % min(A) == 0:
    print(n // min(A) + 4)
else:
    print(n // min(A) + 5)

Solution (Python):
N = int(input())
norimono = []
for _ in range(5):
  norimono.append(int(input()))
  
print((N-1) // min(norimono) + 5)

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

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

d = min(cap)
ans = 5 + ((N-1)//d + 1) - 1

print(ans)

Solution (Python):
import math

n = int(input())
transportations = list(map(int, [input() for _ in range(5)]))

min_trans = min(transportations)

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

Solution (Python):
n=int(input())
inn=[]

times=0

for i in range(5):
    inn.append(int(input()))

mini=min(inn)

if n/mini==int(n/mini):
    print(n//mini + 4)
else:
    print(int(n//mini)+1 + 4)

Solution (Python):


N = int(input())
a = [0]*5
for i in range(5):
    a[i] = int(input())
    
if N % min(a) == 0:
    ans = N // min(a)
else:
    ans = (N // min(a))+1
print(ans+4)

Solution (Python):

import math

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

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

Solution (Python):
import sys

stdout = sys.stdout
rr = lambda: input().strip()
rri = lambda: int(rr())
rrm = lambda: list(map(int, rr().split()))


n = rri()
a = rri()
b = rri()
c = rri()
d = rri()
e = rri()

tiny = min([a,b,c,d,e])
plus = n // tiny
if n % tiny == 0:
    plus -= 1
print(5 + plus)

Solution (Python):
import math
N = int(input())
tran = [int(input()) for i in range(5)]
move = min(tran)
print(math.ceil(N/move)+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())
li = [a, b, c, d, e]

cnt = []
for i in range(5):
    cnt.append(ceil(N / li[i]))
print(max(cnt)+4)

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

Solution (Python):
import math

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

times = [a, b, c, d, e]
counts = [math.ceil(n/a)-1, math.ceil(n/b)-1, math.ceil(n/c)-1, math.ceil(n/d)-1, math.ceil(n/e)-1]
ans = 0
for i in range(5):
    ans += max((counts[i]-ans),0)

ans += 5

print(ans)

Solution (Python):
N = int(input())
l = []
for i  in range(5):
    l.append(int(input()))
btlneck = min(l)
if btlneck >= N:
    ans = 5
else:
    q = N // btlneck
    r = N % btlneck
    ans = q + 5
    if r == 0:
        ans -= 1
print(ans)

Solution (Python):

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

Solution (Python):
import sys
input = sys.stdin.readline
a = [0 for i in range(5)]
n = int(input())
for i in range(5):
    a[i] = int(input())
if n % a[0] == 0:
    time = n // a[0]
else:
    time = n // a[0] + 1
min = a[0]
for i in range(4):
    if min > a[i+1]:
        if n % min == 0:
            time1 = n // min
        else:
            time1 = n // min + 1
        if n % a[i+1] == 0:
            time2 = n // a[i+1]
        else:
            time2 = n // a[i+1] + 1
        time += (time2 - time1)
        min = a[i+1]
    time += 1
print(time)

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

m = min(A)
min_i = A.index(m)
t = N // m
if N % m != 0:
    t += 1
print(t + 4)

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

a = n // min(trans)
if n % min(trans):
    a += 1

print(a + 5 - 1)

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

print(4 -(-N//min(data)))

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)

s = (math.floor(N / m) if N % m != 0 else (math.floor(N/m) - 1)) + 5
print(s)

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    A = []
    input_raw = read_func().strip().split()
    N = long(input_raw[0])
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(long(input_raw[0]))

    min_A = min(A)
    if min_A > N :
        print 5
        return
    x = (N / min_A) + (1 if N % min_A != 0 and N > min_A else 0)



    print x + 4




if __name__ == '__main__':
    main()

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

array = [math.ceil(n/a),
         math.ceil(n/b),
         math.ceil(n/c),
         math.ceil(n/d),
         math.ceil(n/e)]
ans = max(array)+4
print(ans)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(5)]
min_a = min(a)
i_a = a.index(min_a)
ans = 5
if n%min_a==0:
    ans += n//min_a-1
else:
    ans += n//min_a
print(ans)

Solution (Python):
import math
a = []
ans = 0
for i in range(6):
  po = int(input())
  a.append(po)
m = 1000000000000000
for i in range(5):
  if a[i+1] < m:
    m = a[i+1]

delay = math.ceil(a[0]/m) -1
print(5+delay)

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

Solution (Python):
N = int(input())
ABCDE = [int(input()) for _ in range(5)]
ABCDE_sort = sorted(ABCDE)
minimum = ABCDE_sort[0]
print(-(-N//minimum)+4)

Solution (Python):
N = int(raw_input())
cost = list()
for i in xrange(5):
    cost.append(int(raw_input()))

min_cost = 10 ** 16
for i in xrange(5):
    if cost[i] < min_cost: min_cost = cost[i]

if N <= min_cost: print '5'
elif N % min_cost == 0: print (4 + int(N / min_cost))
else:
    print (4 + int(N / min_cost) + 1)

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

mt = min(t)
if N%mt!=0:
    print(int(N / mt) + 5)
else:
    print(int(N/mt) + 4)

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

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

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

cnt = 0
neck = float("inf")
for t in time:
  times = int(N / t)
  if N % t != 0:
    times += 1
  times_n = int(N / neck)
  if N % neck != 0:
    times_n += 1
  if times > times_n:
    cnt += times - times_n + 1
    neck = t
  else:
    cnt += 1
print(cnt)

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

def count(n, m):
    if n % m == 0:
        return int(n / m)
    else:
        return int(n / m + 1)

def max(c, t):
    if c < t:
        return t
    else:
        return c

m = 0
m = max(m, count(N, A))
m = max(m, count(N, B))
m = max(m, count(N, C))
m = max(m, count(N, D))
m = max(m, count(N, E))

print(4 + m)

Solution (Python):
import math

N = int(input())

transportation = [0]*5
for i in range(5):
    transportation[i] = int(input())
    
answer = 5
bottleneck = min(transportation)

print(answer + math.ceil(N/bottleneck)-1)

Solution (Python):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

Solution (Python):
a=[]
N = int(input())
for i in range(5):
    buf = int(input())
    a.append(buf)
Min = min(a)
if N%Min == 0:
    print(N//min(a)+4)
else:
    print(N//min(a)+5)

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

for i in range(5):
  if N//lst[i] == 0:
    div_lst.append(1)
  elif N % lst[i] == 0:
    div_lst.append(N//lst[i])
  else:
    div_lst.append(N//lst[i]+1)

ans = max(div_lst) + 4
    

print(ans)

Solution (Python):
s = []
for i in range(6):
    s.append(int(input()))
n = s.pop(0)
human = min(s)
time = -(-n//human) + 4
print(time)

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
lists=[]
lists.append(a)
lists.append(b)
lists.append(c)
lists.append(d)
lists.append(e)
lists.sort()
s=lists[0]

import math
k=math.floor((n-1)/s)
print(5+k)

Solution (Python):

import sys


def solve(N: int, A: int, B: int, C: int, D: int, E: int):
    R = [A, B, C, D, E]
    mn = min(R)
    ret = max(5, 5 + (N - 1) // mn)
    print(ret)
    return


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))  
    solve(N, A, B, C, D, E)

if __name__ == '__main__':
    main()

Solution (Python):
from math import ceil as c;n=int(input());d=min([int(input())for i in range(5)]);print(c(n/d)+4)

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

    
    A_count = N // A + (0 if N % A == 0 else 1)
    B_count = N // B + (0 if N % B == 0 else 1)
    C_count = N // C + (0 if N % C == 0 else 1)
    D_count = N // D + (0 if N % D == 0 else 1)
    E_count = N // E + (0 if N % E == 0 else 1)

    
    max_count = max([A_count, B_count, C_count, D_count, E_count])

    
    print(max_count + 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())

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

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

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

Solution (Python):
N = int(input())
data = []

div_list = []
for i in range(5):
    data.append(int(input()))
    if N%data[i] == 0:
        div_list.append(int(N/data[i]))
    else:
        div_list.append(int(N/data[i])+1)
count = max(div_list)+4
print(count)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a = IR(5)
    k = II()
    if max(a) - min(a) > k:
        print(":(")
    else:
        print("Yay!")
    return


def B():
    a = IR(5)
    b = a[0]
    ans = 0
    for a_ in a:
        if a_ % 10 != 0:
            if b % 10> a_ % 10:
                b = a_
    flg = 0
    for a_ in a:
        if a_ != b or flg:
            ans += math.ceil(a_ / 10) * 10
        else:
            ans += b
            flg = 1
    print(ans)
            
    
    return


def C():
    n = II()
    ai = IR(5)
    print(math.ceil(n / min(ai)) + 4)
        
        
    return


def D():
    x, y, z, k = LI()
    a = LI()
    a.sort(reverse = True)
    b = LI()
    b.sort(reverse = True)
    c = LI()
    c.sort(reverse=True)
    ans = [0, 0, 0]
    print(a[ans[0]]+b[ans[1]]+c[ans[2]])
    for _ in range(k-1):
        ansa = a[ans[0] - 1] + b[ans[1]] + c[ans[2]]
        ansb = a[ans[0]] + b[ans[1] - 1] + c[ans[2]]
        ansc = a[ans[0]] + b[ans[1]] + c[ans[2] - 1]
        if ansa > ansb:
            if ansa > ansc:
                ans = [ans[0] - 1, ans[1], ans[2]]
            else:
                ans = [ans[0], ans[1], ans[2] - 1]
        else:
            if ansb > ansc:
                ans = [ans[0], ans[1] - 1, ans[2]]
            else:
                ans = [ans[0], ans[1], ans[2] - 1]

        print(a[ans[0]]+b[ans[1]]+c[ans[2]])
                    

    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    C()

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

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

time = (n-1) // min_t + 1

time += 4

print(time)

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
ct=0
l=[a,b,c,d,e]
print((n+min(l)-1)//min(l)+4)

Solution (Python):
import numpy as np
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

list_ = np.array([a, b, c, d, e])

list_min = list_.min()

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

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

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

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

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

delay = (N-1)//min_capa

print(5 + delay)

Solution (Python):



def solv(n, a, b, c, d, e):
    limited = min(a, b, c, d, e)
    ans = 4 + (n + (limited-1)) // limited
    return ans


if __name__ == '__main__':

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

    ans = solv(n, a, b, c, d, e)

    print(ans)

Solution (Python):
import math
n = int(input())
mini = int(input())
for i in range(4):
    tmp = int(input())
    if tmp < mini:
        mini = tmp

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

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
list=[a,b,c,d,e]
min=10**16
ans=0
for i in range(5):
    if list[4-i]<min:
        min=list[4-i]
        ans=4-i
        x=4-i
ans+=6-(x+2)
ans+=-(-n//min)
print(ans)

Solution (Python):

import sys
import os
import itertools
from math import *
    
pnum = int(input())

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

bneck = min(ctime)
bn_index = ctime.index(bneck)


bn_start_time = bn_index


bn_thow_time = ceil(pnum / bneck)


bn_nokori_time = 5 - bn_index

print(bn_index + bn_thow_time + bn_nokori_time - 1)

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

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

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

Solution (Python):


import math

def main():
    N = int(input()) 
    a = int(input()) 
    b = int(input()) 
    c = int(input()) 
    d = int(input()) 
    e = int(input()) 

    lst = [a,b,c,d,e]
    mi = min(a,b,c,d,e) 
    index = lst.index(mi) 
    mintime = math.ceil(N / mi) 
    
    
    
    
    
    print(mintime+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())

m = min([A, B, C, D, E])

if N % m == 0:
    print(5 + (N // m) - 1)
else:
    print(5 + (N // m))

Solution (Python):
import math

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

if n == 0:
    res = 0
else:
    res = math.ceil(n/min(l)) + 4

print(res)

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

neck = min(nums)

if neck >= n:
    print(5)
else:
    print((n - 1) // neck + 5)

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

if N <= min(li):
  ans = 5
elif N > min(li) and N % min(li) == 0:
  ans = N // min(li) + 4
else:
  ans = N // min(li) + 5
print(ans)

Solution (Python):

import math
n = int(input())
a = []
for i in range(5):
    a.append(int(input()))
ans = math.ceil((n/min(a) + 5) - 1)
print(ans)

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

Solution (Python):
import math

N = int(input())





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

print(math.ceil(N / min(M)) + 5 - 1)

Solution (Python):
n = int(input())
lst = [int(input()) for _ in range(5)]
t = 0
m = 0

for (index, ele) in enumerate(lst):
    done = min((t-index) * ele, n-m) 
    m = n - done 
    
    if m % ele == 0:
        t += m // ele
        m = ele
        
    else:
        t += m // ele + 1
        m =  m % ele
        
print(t)

Solution (Python):




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

ans = 0

if min(a)<n:
    nec_i = a.index(min(a))
    nec_n = n//a[nec_i]
    if n%a[nec_i] != 0:
        nec_n+=1
    ans = nec_n+4
else:
    ans = 5

print(ans)

Solution (Python):
n = int(input())
moves = [int(input()) for i in range(5)]
neck = min(moves)
yobun = -(-1 * n // neck)
print(yobun + 4)

Solution (Python):
import sys

N = int(raw_input().split()[0])
M = []
for i in range(5):
    l = int(raw_input().split()[0])
    M.append(l)

a = min(M)

b = (N + a - 1) / a
print(b + 4)

Solution (Python):
import math

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

mi_i = li.index(min(li))
mi_v = min(li)
if mi_v >= N:
	print(5)
else:
	print(math.ceil(N/mi_v)+4)

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

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

Solution (Python):
N = int(input())
min_time = 1000000000000000
for i in range(5):
    a = int(input())
    if min_time > a:
        min_time = a

if N % min_time == 0:
    waste_time = N // min_time - 1
else:
    waste_time = N // min_time
print(waste_time + 5)

Solution (Python):
read = input
n = int(read())
a = [read() for i in range(5)]
a = list(map(int, a))
a = min(a)
if n % a == 0:
    n = n // a
else :
    n = n // a + 1
print( n + 5 - 1 )

Solution (Python):
N = int(input())
t = [int(input()) for i in range(5)]
t.sort()
s = N//t[0]
if N%t[0] != 0 :
    s += 1
print(s+4)

Solution (Python):
N = int(input())
X = [int(input()) for i in range(5)]
min_x = min(X)
min_index = X.index(min_x)

if N%min_x==0:
    time = N//min_x
else:
    time = N//min_x+1

print(time+4)

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

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

Solution (Python):
n = int(input())
a = []
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a_min = min(a)
t = (n+a_min-1)//a_min + 4
print(t)

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

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


def m():
    if n == 1:
        return 5
    if min(a) == 1:
        return n+4
    return n // min(a) + 5


print(m())

Solution (Python):
import math

n = int(input())
capacity = [int(input()) for i in range(5)]

neck = min(capacity)
result = math.ceil(n / neck) + 5 - 1

print(result)

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) > int(N / min(A, B, C, D, E)):
    print(5 + int(N / min(A, B, C, D, E)))
else:
    print(4 + int(N / min(A, B, C, D, E)))

Solution (Python):
IN = [int(input()) for i in [0]*6]
N = IN[0]
AE = IN[1:]
P = [N,0,0,0,0,0]

bn = min(AE)

f = (N % bn == 0)
print(N//bn + 5 - f)

Solution (Python):
N=int(input())
num_list=[]
num_list.append(int(input()))
num_list.append(int(input()))
num_list.append(int(input()))
num_list.append(int(input()))
num_list.append(int(input()))

min_num=min(num_list)
if N%min_num==0:
    group=N//min_num
else:
    group=N//min_num+1
ans=5+(group-1)
print(ans)

Solution (Python):
import math 
step_list = []

for n in range(6):
  if n == 0:
    N = int(input())
  else:
    step_list.append(int(input()))

min_step = min(step_list)

a = math.ceil(N/min_step)

print(a+4)

Solution (Python):

import math
N = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
num = [a,b,c,d,e]
neck = min(num)
t = 4 + math.ceil(N / neck)
print(int(t))

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

capacity = []

for i in range(5):
    c = int(input())
    capacity.append(c)

min_capacity = min(capacity)
print((n + min_capacity - 1) // min_capacity + 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]
m = min(l)
mt = -(-N//m)-1
time = 5 + mt

print(time)

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

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

Solution (Python):



from sys import stdin
import math






input=[]
for _ in range(6):
    input.append(int(stdin.readline().split()[0]))
N=input[0]
train=input[1:6]

mintrain=min(train)
ans=math.ceil(N/mintrain)+4
print(ans)

Solution (Python):
import math

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

mi = t[0]
for i in t:
    mi = min(mi, i)

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

Solution (Python):
from sys import stdin
import math
import numpy as np




x = []
for i in range(6):
  x.append(int(stdin.readline().rstrip().split()[0]))

N,A,B,C,D,E = x
neck = min([A,B,C,D,E])
k = (N-1)//neck+1
print(k+4)

Solution (Python):
n = int(input())
abc = []
abc.append(int(input()))
abc.append(int(input()))
abc.append(int(input()))
abc.append(int(input()))
abc.append(int(input()))


min_num, min_index = abc[4], 4

for i in [3,2,1,0]:
  if abc[i] <= min_num:
    min_num, min_index = abc[i], i
    

min_nums = n // min_num if n % min_num == 0 else n // min_num + 1


print(min_nums + 4)

Solution (Python):
capa = []
n = int(input())

for i in range(5):
    capa.append(int(input()))

if n % min(capa)==0:
    print(n//min(capa)+4)
else:
    print(n//min(capa)+5)

Solution (Python):
import math


N = int(input())
nums = list(map(int, [input() for _ in range(5)]))
m = float('inf')
res = -1
for i, num in enumerate(nums):
  if num < m:
    m = num
    res = i
print(math.ceil(N / m) + 4)

Solution (Python):


















import math
import copy
from collections import defaultdict, Counter

from itertools import product

from itertools import permutations

from itertools import combinations
from bisect import bisect_left, bisect_right


def i_inpl(): return int(input())
def s_inpl(): return map(int,input().split())
def l_inpl(): return list(map(int, input().split()))
INF = float("inf")

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

t = 0
lmin = min(l)
print(math.ceil(N/lmin)+4)

Solution (Python):
N = int(input())
A = [int(input()) for i in range(5)]
if all(a>=N for a in A):
    print(5)
else:
    ans = -(-N // min(A)) + 4
    print(ans)

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

total = 0

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

neck = min(lst)
idx = lst.index(neck)



d, m = divmod(n, neck)
if m > 0:
    total += 1

total += idx + d + (5 - idx - 1)

print(total)