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 count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

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

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

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

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

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

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

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


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


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  n = int(input())
  nums = []
  for i in range(5):
    nums.append(int(input()))
  
  min_num = min(nums)
  print(math.ceil(n/min_num)+4)
  
import math
import fractions
import collections
import itertools
from functools import reduce
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)

T = - ((-N) // m) + 4
print(T)

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lis = [a, b, c, d, e]
x = min(lis)
if n%x == 0:
    x = n//x
else:
    x = n//x + 1
print(5 + x-1)

Solution (Python):
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
X = min(int(input()) for _ in range(5))
print((N + X - 1) // X + 4)

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

def main():
    n = int(input())
    bn = 10**16
    for i in range(5):
        bn = min(bn, int(input()))
    print(-(-n // bn) + 4)

if __name__ == '__main__':
    main()

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

def main():
    n = int(input())
    bn = 10**16
    for i in range(5):
        bn = min(bn, int(input()))
    if bn == 1:
        print(n // bn + 4)
    else:
        print(n // bn + 5)

if __name__ == '__main__':
    main()

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

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

Solution (Python):
from math import ceil, floor




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

Solution (Python):
def main():
    from builtins import int, map, list, print, min
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N = input_number()
    ls = []
    for i in range(5):
        ls.append(input_number())
    mini = min(ls)
    cnt = -(-N//mini)+4
    print(cnt)

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())
x=[A,B,C,D,E]
mi=A
for i in range(5):
 if mi<x[i]:
  x[i]=mi
 else:
  mi=x[i]
print(math.ceil(N/mi)+4)

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

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

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

Solution (Python):
from math import ceil

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

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

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

Solution (Python):
from math import ceil

N = int(input())
ABCDE = [0] * 5
for _ in range(5):
    ABCDE[_] = int(input())

neck = min(ABCDE)
neck_index = ABCDE.index(neck)

ans = ceil(N / neck) + 4
print(ans)

Solution (Python):











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

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


resolve()

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

すると、1分あたりにX人運べる計算になる。Y分あたりにN人より N/Y = X so Y = ceil(N/X)
よってceil(N/X)がその細い所を全員通らせるのにかかる時間。
+スタートしてから細い所を使わない時間 = i-1
+全員が乗り終わってからゴールまで経過する時間 = 5-i
(1人ずつ通す　→　最後の人は遅くとも、5-i分前に乗ってないと。)
'''
print(math.ceil(N/min(L)) + 4)

Solution (Python):
n,*p=map(int,open(0));print((~-min(p)+n)//min(p)+4)

Solution (Python):
import math

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

t_min = min(T)
bottle = math.ceil(N / t_min)
print(5 + (bottle - 1))

Solution (Python):
import math

n = int(input())
trans = sorted(list(int(input()) for _ in range(5)))

ans = math.ceil(n / trans[0]) + 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())
atoe = [a, b, c, d, e]
for _ in range(5):
    for i in range(4):
        if atoe[i]<atoe[i+1]:
            atoe[i+1] = atoe[i]

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

Solution (Python):
n = int(input())
arr = [0] * 5
min_p = 10 ** 16
mi = -1
for i in range(5):
    arr[i] = int(input())
    if arr[i] < min_p:
        min_p = arr[i]
        mi = i

import math
print(4 + math.ceil(n / min_p))

Solution (Python):
import math

N = int(input())
T = [0] * 5
for i in range(5):
    T[i] = int(input())
ans = math.ceil(N / min(T)) + 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())
f = min(a,b,c,d,e)
print(math.ceil(n/f)+4)

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

print(4 + max([(n + i - 1) // i for i in a]))

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

Solution (Python):
n = int(input())
list_L = [int(input()) for _ in range(5)]
list_L.sort()
ans = 0
ans += 5 + n//list_L[0]

if n%list_L[0] == 0:
    ans -= 1

print(ans)

Solution (Python):

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

m=min(trans)
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())

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

Solution (Python):
import sys
import os
import math


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

    N, *TIME = [int(sys.stdin.readline().rstrip()) for _ in range(6)]

    m = min(TIME)
    ret = math.ceil(N / m) + TIME.index(m)
    ret += len(TIME) - TIME.index(m) - 1

    print(ret)


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
ans=0
for i in range(5):
    ans+=1
    a=int(input())
    if N%a==0:
        A=int(N//a)
    else:
        A=int(N//a)+1
    ans=max(ans,A+i)
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):




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

    print(4 - (-N // a))


if __name__ == "__main__":
    main()

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

answer=-(-N//min(A))

print(answer+4)

Solution (Python):

import numpy as np


def submit():
    n = int(input())
    trans_max = [int(input()) for _ in range(5)]
    trans_min = np.min(trans_max)    

    
    group_count = n // trans_min + int(n % trans_min > 0)
    print(5 + group_count - 1)        


if __name__ == "__main__":
    submit()

Solution (Python):

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

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

Solution (Python):

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

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

loads = []
for _ in range(5):
  loads.append(int(input()))
min_load = min(loads)
count = math.ceil(N/min_load)
print(4 + count)

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

m = min(ride)

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

Solution (Python):
import math

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

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


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

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

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

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

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

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

import math

min_p = math.ceil(N / min_p)
print(min_p+4)

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

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

ans = 4 + (N + bottleneck - 1) // bottleneck

print(ans)

Solution (Python):
def main():
  import sys
  input = sys.stdin.readline
  import math
  l=[int(input()) for _ in [0]*6]
  print(5+math.ceil((max(l[0]-min(l[1:]),0))/min(l[1:])))
  
if __name__=='__main__':
  main()

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

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

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

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

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

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

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

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

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

Solution (Python):





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

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

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

Solution (Python):
import sys
from bisect import bisect_left,bisect_right,insort
input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Solution (Python):



from math import ceil

def main():
  n = int(input())
  xs = [int(input()) for _ in range(5)]
  print(ceil(n / min(xs)) + 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(n//m + 4)
else:
    print(n//m + 5)

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

dists = [A, B, C, D, E]
counts = []
total = 0
max_count = 1
for dist in dists:
  count = (N + dist -1) //dist
  counts.append(count)
  total += 1
  if count > max_count:
    total += count - max_count
    max_count = count
print(total)

Solution (Python):
import math

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

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

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

min_capa = min(A,B,C,D,E)
neck_pass_time = max(1, (N + min_capa - 1) // min_capa)
ans = 4 + neck_pass_time
print(ans)

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

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

Solution (Python):
n = int(input())
min = float('inf')
for _ in range(5):
    i = int(input())
    if min > i:
        min = i

if n % min == 0:
    ans = n // min + 4
else:
    ans = n // min + 5

print(ans)

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())
s=[A,B,C,D,E]
x=0
if N%min(s)==0:
  x=N//min(s)
else:x=(N//min(s))+1
print(x+4)

Solution (Python):
import math




import sys
from collections import deque

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

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

    city = [0] * 6
    city[0] = n

    amin = INF
    for i in range(5):
        if amin > a[i]:
           amin = a[i]
           idx = i

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

if __name__ == '__main__':
    main()

Solution (Python):
import math

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

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

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

"""
ans = 4 
real_pas = 10*15+1 
ship_num = 1 
for i in range(5):
    if capa[i] > real_pas:
        pass
    else:
        ship_num = math.ceil(n/capa[i])
        real_pas = capa[i]
        
print(ans+ship_num)"""

Solution (Python):
import math

n = int(input())
caps = [int(input()) for _ in range(5)]
cap = min(caps)

if cap > n:
    print(5)
else:
    pass_time = math.ceil(n / cap)
    print(pass_time + len(caps) - 1)

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

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

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

    i = 0
    capacity = []
    for _ in range(5):
        c = int(input())
        capacity.append(c)
        i += 1

    l = (len(capacity) + 1)
    city = [0] * l
    city[0] = n

    p0 = 0
    for i, c in enumerate(capacity):
        p = i + 1 + (n - 1) // c
        p0 = max(p, p0 + 1)

    print(p0)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
A = []
for i in range(5):
  A.append(int(input()))
ma = min(A)
if n <= ma:
  print(5)
  exit()
else:
  if n % ma == 0:
    print(5 + n//ma - 1)
  else:
    print(5 + n//ma)

Solution (Python):
n = int(input())
abc = []
ans = 0

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

minabc = min(abc)
ans += n//minabc
if n % minabc != 0:
    ans += 1
print(4 + ans)

Solution (Python):
n = int(input())
abc = []
ans = 0

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

minabc = min(abc)
ans += n//minabc
if n % minabc != 0:
    ans += 1

if minabc >= n :
    print(5)
else :
    print(4 + ans)

Solution (Python):
import math
n=int(input())
l=[0]*5
for i in range(5):
  l[i]=int(input())
l.sort()
if l[0]>=n:
  print(5)
else:
  print(math.ceil(n/l[0])+4)

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

Solution (Python):

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

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

Solution (Python):
n=int(input())
risok = float('inf')
for _ in range(5):
    a = int(input())
    risok = min(risok, a)


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

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

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

mi = min(a_d)
num = n//mi

if n%mi != 0:
    num += 1

print(num+4)

Solution (Python):


N = int(input().strip())
pas_list = [int(input().strip()) for _ in range(5)]

count = (  -(-N // min(pas_list)) ) -1+5
print(count)

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

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

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

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

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

Solution (Python):
def need(x,y):
    if x%y==0:
        answer = x//y
    else:
        answer = x//y + 1

    return answer

n = int(input())
move_lst = [int(input()) for _ in range(5)]
min_move = min(move_lst)

answer = need(n, min_move) + 4
print(answer)

Solution (Python):
from math import ceil
n, *A = map(int, open(0).readlines())
print(4 + max(ceil(n / a) for a in A))

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,A,B,C,D,E=map(int,open(0).read().split())
    last_A = ceil(N,A)
    last_B = max(ceil(N,B)+1, last_A+1)
    last_C = max(ceil(N,C)+2, last_B+1)
    last_D = max(ceil(N,D)+3, last_C+1)
    last_E = max(ceil(N,E)+4, last_D+1)
    print(last_E)

    

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

t_list = [A, B, C, D, E]
min_t = min(t_list)
min_i = 0

t_1 = math.ceil(N/min_t)
t_1 = int((N+min_t-1) / min_t)
print(t_1+4)

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

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

Solution (Python):
import math
def main():
    N=int(input())
    A=int(input())
    B=int(input())
    C=int(input())
    D=int(input())
    E=int(input())
    min_num=N+1
    for i in (A,B,C,D,E):
        min_num=min(i,min_num)
    print(math.ceil(N/min_num)+4)
    
if __name__=="__main__":
    main()

Solution (Python):



import math


n = int(input())
ae = list()
for i in range(5):
    ae.append(int(input()))


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


print(ans)

Solution (Python):




n = int(input())
ae = list()
for i in range(5):
    ae.append(int(input()))


minae = min(ae)
ans = n // minae + 4
if n % minae > 0:
    ans = ans + 1


print(ans)

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

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

Solution (Python):
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
time = min(a, b, c, d, e)
if n < time:
    print(5)
else:
    print(math.ceil(n / time) + 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])
q = n//x
r = n%x

if r == 0:
    ans = 5 + q-1
else:
    ans = 5 + q
print(ans)

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

from math import ceil

print(ceil(N / MIN) + 4)

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

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n = ni()
a = []
for _ in range(5):
    a.append(ni())

amin = min(a)
ans = (n-1)//min(a) + 1 + 4
print(ans)

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

ans = (N + m - 1) // m
ans += 4

print(ans)

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

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


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
time =0
amin = min(a,b,c,d,e)
time=(n//amin+1 if n%amin != 0 else n/amin)+4
print(int(time))

Solution (Python):
import numpy as np
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
li = [a,b,c,d,e]
li_min = min(li)
ans = int(np.ceil(n/li_min)) + 4
print(ans)

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

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

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

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

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

Solution (Python):
import math
n = int(input())
lis = [int(input()) for _ in range(5)]
l = len(lis)
m = min(lis)
if n > m:
    l += math.ceil((n-m)/m)
print(l)

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

Solution (Python):
import math

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

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

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

mn = min(toshi)
ans = n//mn+4
if n%mn:
    ans += 1
print(ans)

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
M = [A,B,C,D,E]

Min = min(A,B,C,D,E)
L = M.count(Min)
    
if N % Min == 0:
    Ans = N//Min + 4
else:
    Ans = N//Min + 5
print(Ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





n=ii()
arr=lin(5)
num=min(arr)
if n <=num:
    print(5)
else:
    print(4+ceil(n/num))

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

Solution (Python):
import math

def solve():
    N = int(input())
    ABCDE = []
    for _ in range(5):
        ABCDE.append(int(input()))
        
    min_ = min(ABCDE)
    
    print(math.ceil(N/min_)+4)
    
solve()

Solution (Python):
import math

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

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

import math

a = math.ceil(N/A)
b = math.ceil(N/B)
c = math.ceil(N/C)
d = math.ceil(N/D)
e = math.ceil(N/E)


f = max([a,b,c,d,e])
print(f+4)

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

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

min_cap = min(cap)

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

Solution (Python):
import math

def main():
    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)

if __name__ == '__main__':
    main()

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+5)
else:
    print(N//X+4)

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


if int(n / min(l)) != n / min(l):
    print(int(n / min(l)) + 1 + 4)
else:
    print(int(n / min(l)) + 4)

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

Solution (Python):
n,*L = map(int,open(0).read().split())

print(n//min(L) + 5 if n%min(L)!=0 else n//min(L) +4)

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

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

ans=(m+n-1)//m+4
print(ans)

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

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

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

Solution (Python):

def ceil(x, y):
    if x % y == 0:
        return x//y
    else:
        return (x//y)+1

def solve(n, xs):

   
   
   

   

   
   
   
   

   
   
    min_lim_cost = 10**15+1
    min_lim_pos = -1
    for i in range(5):
        if xs[i] < min_lim_cost:
            min_lim_pos = i
            min_lim_cost = xs[i]

    init_cost = min_lim_pos
    init_reach =  5 - min_lim_pos
    final_reach = ceil((n-min_lim_cost),min_lim_cost)






    return init_cost+init_reach+final_reach


if __name__ == '__main__':
    n = int(input())
    xs= []
    for _ in range(5):
        xs.append(int(input()))
    print(solve(n, xs))

Solution (Python):
from math import ceil
N = int(input())
L = [int(input()) for k in range(5)]
ans = 5
for k in range(5):
    ans = max(ans,4+ceil(N/L[k]))
print(ans)

Solution (Python):
N=int(input())
P=[0]*5
count=0
for i in range (5):
	P[i]=int(input())
for i in range (5):
	if P[i]>=N:
		count+=1
if count==5:
	print(5)
else:
	Q=sorted(P)
	if N%Q[0]==0:
		R=N//Q[0]
		print(R+4)
	else:
		R=N//Q[0]+1
		print(R+4)

Solution (Python):
def main():
    N = int(input())
    G = [int(input()) for i in range(5)]
    G = [(N+g-1)//g for g in G]
    print(max(G)+4)


if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
import math

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

Solution (Python):
n = int(input())
a = [int(input()) for i in range(5)]
t = [-(-n//i) for i in a]
max_t = max(t)
max_i = t.index(max_t)
print(max_t+4)

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

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