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 = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

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

tmp = (n/bottle) - (n//bottle)
if tmp != 0:
    ans = (n // bottle) + 1
else:
    ans = n//bottle
print(ans + 4)

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

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)
ans=-(-n//x)+4
print(ans)

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

Solution (Python):
n = int(input())
p = []
for i in range(5):
    p.append(int(input()))
ans = 0
for i in range(5):
    t = i + (n+p[i]-1) // p[i]
    if t > ans:
        ans += t - ans
    else:
        ans += 1
print(ans)

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

ans = n//min(ways) if n%min(ways) == 0 else n//min(ways)+1
print(ans+4)

Solution (Python):
import math
n,*l=map(int,open(0).read().split())
print(4+math.ceil(n/min(l)))

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

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

xs = [A, B, C, D, E]
min_value = min(xs)
min_index = xs.index(min_value)

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

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

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

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

Solution (Python):
N = int(input())
X = sorted([int(input()) for _ in range(5)])
print((N+(X[0]-1))//X[0]+len(X)-1)

Solution (Python):
N = int(input())
T = []
for i in range(5):
  c = int(input())
  T.append(N // c + 1 * (N % c != 0))
print(5 + max(T) -1)

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

Solution (Python):
import numpy as np
n = int(input())
people = np.array([int(input()) for _ in range(5)])

print(int(4 + np.ceil(n / min(people))))

Solution (Python):
import math

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

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

Solution (Python):
import math

N = int(input())
Vehicle = []

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

mini = min(Vehicle)

answer = math.ceil(N / mini) + 4
print(answer)

Solution (Python):
import sys
from math import ceil

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    P = [INT() for _ in range(5)]
    print(ceil(N/min(P)) + 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())

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

Solution (Python):
from math import ceil

def solve(n, a, b, c, d, e):
    return ceil(n / min([a, b, c, d, e]) + 4)

data = [int(input()) for _ in range(6)]
print(solve(*data))

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

Solution (Python):
def ceil(a, b):
  return -(-a//b)

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

print(ceil(N, min_load) + 4)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    min_AtoE = min([int(input()) for _ in range(5)])
    print((N + min_AtoE - 1) // min_AtoE + 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())

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

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

    min_i = 0
    min_v = AtoE[min_i]
    for i, v in enumerate(AtoE):
        if min_v > v:
            min_i = i
            min_v = v
    
    ans = 0
    for i, v in enumerate(AtoE):
        if min_i == i:
            ans += (N + v - 1 ) // v
        else:
            ans += (min_v + v - 1) // v
    print(ans)

if __name__ == '__main__':
    main()

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

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

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

T_min = min(T_list)


        

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

Solution (Python):
import math

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

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

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

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())
l = [int(input()) for i in range(5)]
print(math.ceil(n/min(l))+5-1)

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

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

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

Solution (Python):

import sys
import math
import os
import itertools
import _collections
import string

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]
    def intListList(n):
        return [cin.mapInt() for i in range(n)]
    def intColsList(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Util.round_up(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x

def main():
    N = cin.int()
    A = cin.intColsList(5)
    M = min(A)
    print(Math.roundUp(N, M) + 4)
    return

if __name__ == "__main__":
    main()

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

arrived_time = -(-N//ABCDE[0])
for i in range(4):
  if ABCDE[i] <= ABCDE[i+1]:
    arrived_time += 1
    ABCDE[i+1] = ABCDE[i]
  else:
    num_left = N - (arrived_time - (i+1))*ABCDE[i+1]
    arrived_time += -(-num_left//ABCDE[i+1])
    
print(arrived_time)

Solution (Python):
n, a, b, c, d, e = [int(input()) for _ in range(6)]
m = min(a, b, c, d, e)
print(-(-n//m)+4)

Solution (Python):
import math

def ceil(n,m):
    return int(math.ceil(n/m))

N = int(input())
A = []

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


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

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

m = min(member)

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

Solution (Python):
def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def main():
    N = int(input())
    m = 10 ** 15
    for _ in range(5):
        m = min(int(input()), m)
    
    print(5 + (N - 1) // m)


if __name__ == "__main__":
    main()

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

mini=min(A)        
print(int((N-1)/mini)+5)

Solution (Python):
import sys
from math import ceil

n, *cap = map(int, sys.stdin.read().split())

def main():
    return 4 + ceil(n / min(cap))

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
import sys
from math import ceil

n, *cap = map(int, sys.stdin.read().split())

def main():
    min_cap = min(cap)
    i = cap.index(min_cap) + 1
    
    res = (i - 1) + ceil(n / min_cap) + (5 - i)
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
n = int(input())
min_n = int(input())
for _ in range(4):
    min_n = min(min_n, int(input()))
t = n // min_n
if n % min_n != 0:
    t += 1
print(t + 4)

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

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

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

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

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

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

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

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

print(-(-N // min(A)) + 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)
print(-(-N//min)+4)

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

Solution (Python):

n = int(input())

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

def calculate(arr,n):
    minVal = min(arr)
    return int(((minVal + n - 1) / minVal) + 4)

result = calculate(arr,n)
print(result)

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)

ans = 5 + max(a,b,c,d,e) - 1

print(ans)

Solution (Python):
from math import ceil


def main():
    N = int(input())
    capacity = []
    for _ in range(5):
        capacity.append(int(input()))
    min_capacity = min(capacity)
    if N <= min_capacity:
        print(5)
    else:
        print(4 + ceil(N / min_capacity))


if __name__ == '__main__':
    main()

Solution (Python):
import math
n = int(input())
a = list(int(input()) for _ in range(5))
print(math.ceil(n/min(a))+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())

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

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

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

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

A = []
for _ in range(5):
  A.append(int(input()))
  
import math
L = math.ceil(N/min(A))

print(5 + L - 1)

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

Solution (Python):

import math
import heapq
import bisect
import numpy as np


N = int(input())
time = []

for i in range(5):
    a = int(input())
    time.append(a)

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

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

Solution (Python):
import math
import numpy as np
from fractions import gcd
import fractions
import statistics
import collections
from functools import reduce
import itertools
 
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())
traffics = []
for _ in range(5):
    traffics.append(int(input()))

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

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())
a = [int(input()) for _ in range(5)]
mn = min(a)
print((n + mn - 1) // mn + 4)

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

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

print((N // s + (N % s != 0) - 1) + 5)

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

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

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

Solution (Python):
import sys
import math

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

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

main()

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

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

Solution (Python):

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)

if N%bn==0:
    num=N//bn
else:
    num=N//bn+1

print(num+4)

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

import math
n, *lst = map(int, read().split())
t = prep = math.ceil(n / lst[0])
for i in lst[1:]:
  tt = math.ceil(n / i)
  if tt <= prep:
    t += 1
  else:
    t += 1 + tt - prep
    prep = tt
print(t)

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

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

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

print(ans)

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

Solution (Python):
from math import ceil

N, *ABCDE = map(int, open(0).read().split())
bottle_neck = min(ABCDE)
print(ceil(N / bottle_neck) + 4)

Solution (Python):
import math


N, *ABCDE = map(int, open(0).read().split())
bottle_neck = min(ABCDE)
print(math.ceil(N/bottle_neck) + 4)

Solution (Python):
import math


def main():
    N, *ABCDE = map(int, open(0).read().split())

    bottle_neck = min(ABCDE)
    
    print(math.ceil(N/bottle_neck) + 4)


if __name__ == "__main__":
    main()

Solution (Python):
import math

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

Solution (Python):
from math import ceil
n=int(input())
a=int(input())
for i in range(4):
    a=min(int(input()),a)

g=ceil(n/a)
print(g-1+5)

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().rstrip()) for i in range(6)]

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

ans = int(n/f) + (0 if n % f == 0 else 1) + 4
print(ans)

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

Solution (Python):
from math import ceil

n = int(input())
a = [int(input()) for i in range(5)]
mn = min(a)
print(4 + ceil(n / mn))

Solution (Python):

def solve(N,T):
    import math
    ans = 0
    for i in range(len(T)):
        ans = max(ans, math.ceil(N/T[i]))
    ans += 4
    print(ans)

def main():
    N = int(input())
    T = [int(input()) for _ in range(5)]
    solve(N, T)

if __name__ == "__main__":
    main()

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

Solution (Python):
import math

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

data = [A,B,C,D,E]
data.sort()

time = math.ceil(N/data[0])+4
if data[0] >= N:
    time = 5

print(time)

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):
n = int(input())
barrier = [int(input()) for _ in range(5)]
count = 0

min_p = barrier.index(min(barrier))
print(min_p+(n//barrier[min_p] + (n % barrier[min_p] > 0))+5-min_p-1)

Solution (Python):
import math
n=int(input())
minnum=9999999999999999999999999
for _ in range(5):
    a= int(input())
    if a<minnum:
        minnum=a

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

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

div = min(li)
gr = math.ceil(n / div)
print(5+gr-1)

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
print((-n)//min(a,b,c,d,e)*(-1)+4)

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

Solution (Python):
import math

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

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

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

Solution (Python):
n,a,b,c,d,e = [int(input()) for i in range(6)]
print(-(-n//min(a,b,c,d,e))+4)

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

Solution (Python):

import math

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

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

mx = min(a, b, c, d, e)
print(ceil(n/mx) + 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)
t=math.ceil(n/m)+4
print(t)

Solution (Python):
l=[int(input()) for i in range(6)]
n=l[0]
min_=min(l[1:])
print(n//min_+1+4 if n%min_!=0 else n//min_+4)

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

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

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

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7





N = int(sys.stdin.buffer.readline())
A = [int(sys.stdin.buffer.readline()) for _ in range(5)]
flow = min(A)
ans = math.ceil(N / flow) + 4
print(ans)

Solution (Python):
import math

def my_solve2():
    """
    最短時間はもっとも移動可能人数が少ない区間に依存する
    """
    num = int(input())
    transpotations = []
    for _ in range(5):
        transpotations.append(int(input()))

    
    
    bottleneck = min(transpotations)

    
    time = math.ceil(num / bottleneck)

    time += 4
    return time


def my_solve():
    """
    未完成
    現在の人の分布と1分後の人の分布を分けて考えるために2つの人分布リストが必要
    この方法では制限時間内に計算を終了することができない
    """
    num = int(input())
    
    traffic_a = int(input())
    traffic_b = int(input())
    traffic_c = int(input())
    traffic_d = int(input())
    traffic_e = int(input())

    city_people_num = [num, 0, 0, 0, 0, 0]

    time = 0
    
    while city_people_num[5] < num:
        
        
        if city_people_num[0] >= traffic_a:
            city_people_num[0] -= traffic_a
            city_people_num[1] += traffic_a
        else:
            city_people_num[1] += city_people_num[0]
            city_people_num[0] = 0
        
        time += 1
        
        if city_people_num[1] >= traffic_b:
            city_people_num[1] -= traffic_b
            city_people_num[2] += traffic_b
        else:
            city_people_num[2] += city_people_num[1]
            city_people_num[1] = 0
        
        time += 1
        
        if city_people_num[2] >= traffic_c:
            city_people_num[2] -= traffic_c
            city_people_num[3] += traffic_c
        else:
            city_people_num[3] += city_people_num[2]
            city_people_num[2] = 0
        time += 1
        
        if city_people_num[3] >= traffic_d:
            city_people_num[3] -= traffic_d
            city_people_num[4] += traffic_d
        else:
            city_people_num[4] += city_people_num[3]
            city_people_num[3] = 0
        time += 1
        
        if city_people_num[4] >= traffic_e:
            city_people_num[4] -= traffic_e
            city_people_num[5] += traffic_e
        else:
            city_people_num[5] += city_people_num[4]
            city_people_num[4] = 0
        time += 1
        
        

    return time

print(my_solve2())

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

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

ans = -(-n // min(l)) + 4
print(ans)

Solution (Python):
def examA():
    X = [I() for _ in range(5)]
    k = I()
    X.sort()
    ans = "Yay!"
    if X[-1]-X[0]>k:
        ans = ":("
    print(ans)
    return

def examB():
    X = [I() for _ in range(5)]
    ans = 0
    for i in range(5):
        ans += (X[i]+9)//10 *10
        X[i] = (X[i]-1)%10
    ans -= (9-min(X))
    print(ans)
    return

def examC():
    N = I()
    X = [I() for _ in range(5)]
    ans = max(0,(N-1)//min(X))+5
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,inf
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examC()

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

    bottleneck = (0, 10**15)
    for i, t in enumerate(T):
        if t <= bottleneck[1]:
            bottleneck = (i, t)
    
    if N % bottleneck[1] == 0:
        print(bottleneck[0] + N // bottleneck[1] + 4 - bottleneck[0])
    else:
        print(bottleneck[0] + N // bottleneck[1] + 1 + 4 - bottleneck[0])


if __name__ == '__main__':
    solve()

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

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())
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())
man = [int(input()) for i in range(5)]

min1 = float("inf")
for i in range(5):
    min1 = min(min1, man[i])
ans = math.ceil(n / min1)
print(ans+4)

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

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

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

Solution (Python):
import math

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

Solution (Python):
import math

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

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

Solution (Python):
import math

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

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

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

real = [float("inf")]
for i in range(len(traffic)):
    if real[-1] < traffic[i]:
        real.append(real[-1])
        continue

    real.append(traffic[i])

print(math.ceil(n/real[-1]) + 4)

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

print(math.ceil(n/min(a))+5-1)

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

mt = min(time)
if N%mt == 0:
    tt = N//mt
else:
    tt = N//mt+1
ans = tt + 4
print(ans)

Solution (Python):
import math
n=int(input())
x=[]
for i in range(5):
  x.append(int(input()))
a=min(x)
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())


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

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

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())
nekku = min(A)
ans = N//nekku + 4
if N%nekku != 0:
    ans += 1
print(ans)

Solution (Python):

import math

n = int(input())
capacities = [int(input()) for i in range(5)]
min_v = min(capacities)
ans = math.floor((n + min_v - 1) / min_v + 4)
print(ans)

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

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

Solution (Python):
N = int(input())
A=[int(input()) for i in range(5)]
B=min(A)
cnt = 4
cnt += N//B
if N%B!=0:
  cnt += 1
print(cnt)

Solution (Python):
from math import *

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

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

print(ceil(n/mn)+4)

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

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
L = min([A,B,C,D,E])
T = N // L
if N % L > 0:
    T += 1
print(T+4)

Solution (Python):
N = int(input())
ls = [int(input()) for _ in range(5)]
X = min(ls)
print((N+X-1)//X+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):
import math
N=int(input())
A,B,C,D,E=int(input()),int(input()),int(input()),int(input()),int(input())
print(math.ceil(N/min(A,B,C,D,E))+4)

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

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

Solution (Python):
from math import ceil
N = int(input())
print(max(map(lambda num: ceil(N / num), (int(input()) for _ in range(5)))) + 4)

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

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

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

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

Solution (Python):
import math
N = int(input())
trans = [int(input()) for _ in range(5)]
minind = trans.index(min(trans))
print(minind+math.ceil(N/min(trans))-1+5-minind)

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

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

if n<=m:
      print(5)
      exit()

a=n//m-1 if n%m==0 else n//m

print(5+a)

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

print(int(5+(N-1/2)//ans))

Solution (Python):
n = int(input())
ride = []
for i in range(5):
    ride.append(int(input()))
if n%min(ride) != 0:
    s = 1
else:
    s = 0

print(4+n//min(ride)+s)

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

mn = 1e17

for i in range (5):
  nn = int(input())
  mn = min(mn, nn)
  
cnt = n//mn
if n%mn != 0:
  cnt += 1
  
print(str(cnt+4))

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

m=0
for i in range(5):
    if x[m]>x[i]:
        m=i
if m==0:
    print(5+math.ceil(n/x[0])-1)
else:
    print(5+math.ceil(n/x[m])-1)

Solution (Python):
import math

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

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

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

Solution (Python):
import math

def main():
    N = int(input())
    timelist = [int(input()) for i in range(5)]

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

if __name__ == '__main__':
    main()