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):
def ii2ss(n):
    ss = []
    for i in range(n):
        ss.append(input())
    return ss

def sp2nn(sp, sep=' '):
    return [int(s) for s in sp.split(sep)]

def ss2nn(ss):
    return [int(s) for s in list(ss)]

import math
def main(ss):
    N, A, B, C, D, E = ss2nn(ss)
    m = min(A, B, C, D, E)
    return math.ceil(N / m) + 4

ss = ii2ss(6)
print(main(ss))

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

num_.sort()


if N%num_[0] == 0:
  ans = int(N/num_[0])
else:
  ans = int(N/num_[0])+1
print(ans + 4)

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

Solution (Python):
import sys
import math


def solve(lines):
    lines = [int(x) for x in lines]
    n = lines[0]
    lines = lines[1:]

    cap = min(lines)
    k = math.ceil(n / cap)
    print(4 + k)


if __name__ == '__main__':
    lines = sys.stdin.read()
    lines = lines.strip().split('\n')
    solve(lines)

Solution (Python):

ns = [int(input()) for _ in range(6)]
ans = 0
min_n = min(ns[1:])
if ns[0] % min_n != 0:
    ans = 5 + ns[0] // min_n
else:
    ans = 5 + ns[0] // min_n - 1
print(ans)

Solution (Python):
from math import ceil
n = int(input())
Min = 1000000000000010
for _ in range(5):
    Min = min(Min, int(input()))
g = ceil(n / Min)
print(4 + g)

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

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

def minute(p):
    p[5] += min(E,p[4])
    p[4] = max(0,p[4]-E)
    p[4] += min(D,p[3])
    p[3] = max(0,p[3]-D)
    p[3] += min(C,p[2])
    p[2] = max(0,p[2]-C)
    p[2] += min(B,p[1]) 
    p[1] = max(0,p[1]-B)
    p[1] += min(A,p[0])
    p[0] = max(0,p[0]-A)
    return p
    
p = [N,0,0,0,0,0]
for i in range(100):
    p = minute(p)
    if p[-1] == N:
        print(i+1)
        break
if p[-1] != N:
    r = p[-1]
    r_ = minute(p)[-1]
    x = r_-r
    from math import ceil
    print(100+ceil((N-r)/x))

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

mn = min(l)

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

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

Solution (Python):
import math

num = int(input())

cap_vehicles = [0,0,0,0,0]

for i in range(5):
  cap_vehicles[i] = int(input())

bottleNeck = min(cap_vehicles)

print(math.ceil(num / bottleNeck) + 4)

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

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

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

tmplist = [A,B,C,D,E]
max_time_list = []
for x in tmplist:
    dim = N/x
    max_time_list.append(int(dim)+1 if int(dim)!=dim else int(dim))

print(max(max_time_list)+4)

Solution (Python):
import math

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

Solution (Python):
n,*a=map(int,open(0).read().split())
b=min(a)
if b<n:
    print(n//b+(n%b>0)-1+5)
else:
    print(5)

Solution (Python):
N, A, B, C, D, E = [int(input()) for _ in range(6)]

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

bottleneck = min(transportations)
bottleneck_way = transportations.index(bottleneck)

print(-(-N // bottleneck) + bottleneck_way + 4 - bottleneck_way)

Solution (Python):
def main():
	n = int(input())
	r = [0]*5
	r[0] = int(input())
	r[1] = int(input())
	r[2] = int(input())
	r[3] = int(input())
	r[4] = int(input())
	total = 4
	min_r = min(r)
	div = n // min_r
	mod = n % min_r
	total += div
	if mod != 0:
		total += 1

	print(total)

if __name__ == '__main__':
    main()

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

a = min(x)
if a >= N:
    print(5)
else:
    ans = -(-N // a)
    ans += 4
    print(ans)

Solution (Python):




n = int(input())
tl = list()
minval = 10 ** 16

for i in range(5):
    tl.append(int(input()))
    if tl[i] < minval:
        minval = tl[i]

ans = int(n / minval) + 4
if n % minval > 0:
    ans += 1


print(ans)

Solution (Python):
def __main__():
    N = int(input())
    trans = []
    for i in range(5):
        trans.append(int(input()))
    bn = min(trans)
    print(4 + (N-1)//bn + 1)
if __name__ == "__main__":
    __main__()

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

numTr = []

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

miniNum = N // numTr[0]
remNum = N % numTr[0]

if remNum != 0:
  miniNum += 1
  
minutes = miniNum + 4

print(minutes)

Solution (Python):
def main():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    norimono = [A,B,C,D,E]
    norimono.sort()
    kaisuu = N // norimono[0]
    if N % norimono[0] != 0:
        kaisuu += 1
    print(kaisuu + 4)

main()

Solution (Python):
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N = read_a_int()
A = read_col(5, 1)[0]



key = min(A)

if N % key == 0:
    print(N//key+4)
else:
    print(N // key + 5)

Solution (Python):
from sys import stdin
import math

people = int(input())
sus = [int(input()) for i in range(5)]

minpeople = min(sus)

div = math.ceil(people/minpeople)

print(5+div-1)

Solution (Python):
import math

a = []

n =  int(input())


a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))

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())

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

div = list[0]

q = n // div
p = n % div

if p != 0:
    print(5+q)
else:
    print(4+q)

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

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

Solution (Python):


import math
import sys
import itertools
import numpy as np

n =int(input())

m = -1
a = 9999988888999991


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

for i in range(5):
    if t[i] <= a:
        m=i
        a=t[i]

answer = n//a 
if n % a == 0:
    answer -= 1
answer += 5
print( answer )

Solution (Python):
import math

n = int(input())
a = []
min_a = 10**15
for i in range(5):
    a.append(int(input()))
    if a[-1] < min_a:
        min_a = a[-1]

if min_a >= n:
    print(5)
else:
    print(math.ceil(n/min_a)+4)

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

mini = min(A)
index = A.index(mini)
index + 1
ans = 4 + math.ceil(N/mini)
print(ans)

Solution (Python):
n=int(input())
ride=[int(input()) for x in [0]*5]
import math
print(5-1+math.ceil(n/min(ride)))

Solution (Python):
n = int(input())
capa = [int(input()) for _ in range(5)]
for i in range(0,4):
    if capa[i] < capa[i + 1]:
        capa[i + 1] = capa[i]
ans = 4 + n // capa[4] + (0 if n % capa[4] == 0 else 1)
print(ans)

Solution (Python):
N = int(input())
minn = float("inf")
for _ in range(5):
    n = int(input())
    minn = min(minn, n)
print((N - 1) // minn + 5)

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

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

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

st = []
st += [a,b,c,d,e]

print((n-1) // min(st) + 5)

Solution (Python):
import numpy as np
data = [int(input()) for _ in range(6)]
n = data[0]
ae = data[1:]
idx_band = np.argmin(ae)
band  = ae[idx_band]
print(np.ceil(n/band).astype(int) + 4 )

Solution (Python):
import sys,math
input = sys.stdin.readline

N,A,B,C,D,E=[int(input().strip()) for x in range(6)]

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

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

cnt = 0

min = 10**16
min_ind = 0
for i in range(5):
    if min > list[i]:
        min = list[i]
        min_ind = i


if n % list[min_ind] == 0:
    print(4 - min_ind + n // list[min_ind] + min_ind)
else:
    print(5 - min_ind + n // list[min_ind] + min_ind)

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

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

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

Solution (Python):
from math import *
n=int(input())
arr=[]
for i in range(5):
	t=int(input())
	arr.append(t)
if(n%min(arr)==0):
	ans=4+(n//min(arr))
else:
	ans=5+(n//min(arr))
print(ans)

Solution (Python):
import math

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

most_narrow = min(ALPHA)
print(str(math.ceil(N / most_narrow) + 4))

Solution (Python):
import math

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

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

p = math.ceil(N / min(l))

print(4 + p)

Solution (Python):
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
inputs = [A, B, C, D, E]
howManyTimes = []
for num in inputs:
    howManyTimes.append(math.ceil(N / num))
bottleneck = howManyTimes.index(max(howManyTimes))

print(4 + howManyTimes[bottleneck])

Solution (Python):
N = input()
A2E = [input() for _ in range(5)]
print 4 + N / min(A2E) + min(1, N % min(A2E))

Solution (Python):
import math

list=[]

n=int(input())

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

list=sorted(list)




min=list[0][0]

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

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

minTrans = min( A[0], A[1] )
for i in range(2,5):
    minTrans = min( minTrans, A[i] )

print( (N+minTrans-1)//minTrans + 4 )

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

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

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

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

ans = 5
if n % min_v == 0:
    ans += n // min_v - 1
else:
    ans += (n // min_v)

print(ans)

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

A=-(-n // a)
B=-(-n // b)
C=-(-n // c)
D=-(-n // d)
E=-(-n // e)

M=max([A,B,C,D,E])

X=M+4

print(X)

Solution (Python):
import math

N=int(input())
a=[]
for z in range(5):
  a.append(int(input()))

a=sorted(a)
buf=a[0]
ans=math.ceil(N/buf)+4
print(ans)

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

Solution (Python):
import math

N = int(input())
people = [int(input()) for _ in range(5)]
max_turn = max(map(lambda x: math.ceil(N / x), people))
print(max_turn + 4)

Solution (Python):
vehicles = []

N = int(input())

for _ in range(5):
    x = int(input())
    vehicles.append(x)

import math
min_num = N / min(vehicles)
min_num = math.ceil(min_num)


print(5 + min_num - 1)

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

out = 4 + int(math.ceil(N / min(Xs)))
print(out)

Solution (Python):

import math

def solve():
    N = int(input())
    vehicles = []
    for i in range(0, 5):
        vehicles.append(int(input()))
    
    botle_neck = vehicles[0]
    for i in range(1, 5):
        if vehicles[i] < botle_neck:
            botle_neck = vehicles[i]
            continue
        else:
            vehicles[i] = botle_neck
    
    
    ans = math.ceil(N/vehicles[4]) + 4

    print(ans)



if __name__ == "__main__":
    solve()

Solution (Python):


import math

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

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

m = math.ceil(N / min_num)

total = m + 4

print(total)

Solution (Python):


a = [0]*5
n = int(input())
a[0] = int(input())
a[1] = int(input())
a[2] = int(input())
a[3] = int(input())
a[4] = int(input())

bottle = min(a[0],a[1],a[2],a[3],a[4])

time = 0

if n % bottle == 0:
    time = int(n / bottle)
else:
    time = int(n // bottle) + 1

if bottle >= n:
    print(5)
else:
    print(time+4)

Solution (Python):
import numpy as np


n = int(input())
minlim = 10**15
for i in range(5):
    lim = int(input())
    if lim < minlim:
        minlim = lim

if minlim < n:
    if n % minlim == 0:
        print(n//minlim + 4)
    else:
        print(n//minlim + 5)
else:
    print(5)

Solution (Python):
n = int(input())
mins = [(int(input()),idx) for idx in range(5)]
if min(mins)[0] > n:
    print(5)
else:
    ans = n // min(mins)[0] + 1 * ((n%(min(mins)[0]))>0)
    print(ans+4)

Solution (Python):



import math

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

count = 0
for i in range(1, 6):
    if min(X[:i]) > X[i]:
        count += math.ceil((N - (count - i + 1) * X[i]) / X[i])
    else:
        count += 1
        
print(count)

Solution (Python):
import math

N = int(input())
idou = [int(input()) for _ in range(5)]
hosoi = min(idou)

ans = 5
if hosoi < N:
    ans += math.ceil(N / hosoi) -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(ceil(n/(min(a,b,c,e,d))+4))

Solution (Python):
import math
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)
q = math.ceil(n/m)
print(q+4)

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

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

if n % min(v):
  print(n // min(v) + 5)
else:
  print(n // min(v) + 4)

Solution (Python):
n,*t=map(int,open(0).read().split())
print(int((n-0.1)//min(t))+5)

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
def solve():
    min_number = min([A,B,C,D,E])
    if(N%min_number==0):
        return print(5 + int(N/min_number) - 1)
    else:
        return print(5 + int(N/min_number))
solve()

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







if n <= min(alist):
    print(5)
else:
    print((n-1)//min(alist)+5)

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

Solution (Python):
N = int(input())
capacity = [int(input()) for _ in range(5)]
m = min(capacity)
if(m>=N):
    print(5)
elif(N%m==0):
    print(int(N/m)+4)
else:
    print(int(N/m)+5)

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

Solution (Python):
N = int(input())
capa = [int(input()) for i in range(5)]
m = min(capa)
if N%m == 0:
    ans = 4 + N//m
else:
    ans = 5 + N//m

print(ans)

Solution (Python):
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())


mn = min(A)
minidx = A.index(mn)
ans = 0
ans = minidx

ans += ( N + A[minidx] -1)//A[minidx]
ans += 5 - 1 - minidx
print(ans)

Solution (Python):
import math

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

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

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

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

num_group = math.ceil(N / cap)

ans = 5 + num_group - 1
print(ans)

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

Solution (Python):
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = [a, b, c, d, e]
min_A = min(A)
result = math.ceil(n / min_A) - 1 + 5
print(result)

Solution (Python):
import math

N = int(input())

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

slow = int(transp.index(min(transp)))

k, l = divmod(N, transp[slow])
time = k + 4 
if l > 0:
    time += 1

print(time)

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

Solution (Python):
import math

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

I = float("INF")
c = 0
for i in reversed(range(5)):
    if I >= A[i]:
        c = i
        I = A[i]

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

Solution (Python):
import math

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

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

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

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

m = min(city)

if N%m == 0:
    ans = N//m + 4
else:
    ans = N//m + 5

print(ans)

Solution (Python):
import math

n = int(input())
t = []

for i in range(0, 5):
    t.append(int(input()))

m = min(t)
if n <= m:
    print(5)
else:
    print(4 + math.ceil(n / m))

Solution (Python):
import math

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

for i in range(1, 5):
    if t[i] > t[i-1]:
        t[i] = t[i-1]

print(math.ceil(n/t[4]) + 4)

Solution (Python):
from math import ceil

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

print(ceil(N / min(e)) + 4)

Solution (Python):

"""
Created on Sat Feb 16 20:52:46 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy
import bisect


def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

    
all(nstr.count(c) for c in '753')


ABT = zip(A, B, totAB)
result = 0

sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)


(x >> i) & 1


dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    

"""
N = int(input())

A = [0]*5

A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

if N <= min(A):
    print(5)
    sys.exit()

n = N//min(A)
if N%min(A) ==0:
    pass
else:
    n += 1

print(n+5-1)

Solution (Python):
"""
python3 main.py < input.txt
"""
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])
times=int(math.ceil(n/m))
print(times+4)

Solution (Python):


import math

def readInts():
  return [int(s) for s in input().split(" ")]

def readInt():
  return readInts()[0]

def solve(N, A, B, C, D, E):
  v = min(A, B, C, D, E)
  return math.ceil(N / v) + 4

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

  print(solve(N, A, B, C, D, E))

if __name__ == "__main__":
  main()

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

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

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

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

min_data = min(data_list)

if min_data!= 1:
    print(N//min_data+5)
else:
    print(N-1+5)

Solution (Python):
N=int(input())
Times=[int(input()) for i in range(5)]
mintime=min(Times)
ans=N//mintime+(N%mintime!=0)+4
print(ans)

Solution (Python):


def io_generator():
	return input()


	
def ku(n,a):
	if n % a==0:
		return int(n/a)
	return (n // a)+1
	
def main(io):
	n=int(io())
	l =[ int(io()) for _ in range(5)]
	bn=min(l)
	nd=ku(n,bn)
	return 4+nd



if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

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

Solution (Python):
import numpy as np
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())
k=np.argmin(a)
if n%a[k]==0:
    l=n//a[k]
else:
    l=n//a[k]+1
print(4+l)

Solution (Python):


N = int(input())

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

min_flow = min(flows)

if N % min_flow == 0:
    ans = int(N / min_flow)
else:
    ans = int(N / min_flow) + 1
    
print(ans + 4)

Solution (Python):
import math

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

mi = min(l)

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

Solution (Python):
n=int(input());m=[int(input())for _ in range(5)];s=min(m);print((n%s>0)+4+n//s)

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

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

minl = min(load)

if (n%minl==0):
    print(n//minl-1+5)

if (n%minl!=0):
    print(n//minl+5)

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
mini = min(a,b,c,d,e)
nn = n // mini
if mini == 1:
    nn = n-1
print(nn+5)

Solution (Python):
n = int(input())
capacity = [None] * 5

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

min_cap = min(capacity)

t = n // min_cap + (0 if n % min_cap == 0 else 1) + 4
print(t)

Solution (Python):
N = int(input())
min_cap = float('inf')
for i in range(5):
    temp = int(input())
    min_cap = min(min_cap, temp)
print(5 + N // min_cap - (N % min_cap == 0))

Solution (Python):
import numpy as np

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 = np.array(A)
min_A = np.min(A)
print(int(np.ceil(N/min_A) + 5 - 1))

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

min_n = min(a[1:])

if(a[0] % min_n == 0): print(4+a[0]//min_n)
else: print(5+a[0]//min_n)

Solution (Python):
import math
n = int(input())
t = [int(input()) for i in range(5)]
t = sorted(t)
ans = math.ceil(n/t[0]) -1 + 5
print(ans)

Solution (Python):

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

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

main()

Solution (Python):
n = int(input())
m = 0
for i in range(5):
    t = int(input())
    c = n // t
    if n % t != 0:
        c += 1
    m = max(c, m)

print(6 - 1 + m - 1)

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

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

Solution (Python):
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
A = [I() for i in range(5)]
num = min(A)

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

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

Solution (Python):
import math

n, *caps = [int(input()), int(input()), int(input()), int(input()), int(input()), int(input())]

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

Solution (Python):


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

    if N==1:
        print(5)
        return

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

    ans = (N//m) - (N%m==0)
    ans += 5

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np

N = int(input())
S = np.zeros(5)
S[0] = int(input())
S[1] = int(input())
S[2] = int(input())
S[3] = int(input())
S[4] = int(input())

ANS=4-(-N//S.min())

print(str(int(ANS)))

Solution (Python):
N=int(input())
L=[int(input()) for _ in range(5)]
ans=0
l=min(L)

for i in range(5):
    if L[i]==l:
        break

if N<min(L):
    ans=5
else:
    if N%L[i]==0:
        ans=N//L[i]+4
    else:
        ans=N//L[i]+5

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)

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

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

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N=INT()
tran=[INT() for i in range(5)]
print(5-1+ceil(N, min(tran)))

Solution (Python):
import numpy as np
import math

N=int(input())
X=np.zeros(5)
for i in range(5):
  X[i]=int(input())

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

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

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)


t = 5
k = max(0, N - m) // m
t += k



k = 1 if max(0, N - m) % m > 0 else 0
t += k


print(t)

Solution (Python):


from math import ceil


n = int(input())

min_limit = 10 ** 15
for i in range(5):
    x = int(input())
    min_limit = min_limit if min_limit < x else x

t = ceil(n / min_limit) + 4

print(t)

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

if N % min(li):
    ans = N // min(li) + 1
else:
    ans = N // min(li)

print(4 + ans)

Solution (Python):
import math
inputs = []
for i in range(6):
    tmp = int(input())
    inputs.append(tmp)

n = inputs[0]
lim = inputs[1:]
minlim = min(lim)
print(math.ceil(n/minlim) + 4)

Solution (Python):
import sys
import math

n = int(sys.stdin.readline())
cs = [int(sys.stdin.readline()) for _ in range(5)]
mc = min(cs)
ret = 4 + int(math.ceil(n / mc))
print(ret)