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

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007


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


def B():
    s = IR(5)
    s.sort(key = lambda x:-x%10)
    ans = 0
    i = 0
    k = 0
    while 1:
        if i%10 == 0:
            ans = i+s[k]
            i += s[k]-1
            k += 1
            if k == 5:break
        i += 1
    print(ans)
    return


def C():
    n = I()
    a = IR(5)
    ans = 5+n//min(a)
    if n%min(a) == 0:ans -= 1
    print(ans)
    return


def D():
    x,y,z,k = LI()
    a = LI()
    b = LI()
    c = LI()

    return


if __name__ == "__main__":
    C()

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

m = min(a)
mi = a.index(m)
res = 0
if n%m==0:
    res += n//m
    res += 4
else:
    res += n//m
    res += 1
    res += 4
print(res)

Solution (Python):
a = []
N = int(input())
min_v = 10**15 + 1
for i in range(5):
    v = int(input())
    min_v = min(min_v, v)

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

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

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

print(((N-1)//min(mem))+M)

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

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

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

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)

bottleneck_time = (n + bottleneck-1) // bottleneck

print(bottleneck_time + 4)

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]
minn = min(lis)
m = 0
if n % minn == 0:
    m = n // minn
else:
    m = n // minn + 1
print(m + 4)

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

Solution (Python):


import math

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

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

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

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

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

Solution (Python):
import math

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

result = float(person)/float(min(number))

print(int(math.ceil(result)+4))

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
abcde = [ni() for _ in range(5)]

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

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

s = [a, b, c, d, e]
mins = min(s)
ans = math.floor((n-0.5)/mins) + len(s)

print(ans)

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

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

bn = -(-N//min(l))
print(4 + bn)

Solution (Python):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()
ans = 0
for i in [0] * 5:
    P = input()
    num = N / P
    if N % P:
        num += 1
    ans = max(ans, num)
print ans + 4

Solution (Python):
import math

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

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

Solution (Python):
import sys
from itertools import permutations

N = int(sys.stdin.readline())
prev, prev_delay = None, None
out = []
for _ in range(5):
    x = int(sys.stdin.readline())
    if prev is None or prev >= x:
        d = N // x
        r = N % x
        prev = x
        prev_delay = d + (1 if r > 0 else 0)
    else:
        prev = x
    out.append(prev_delay)

ret = out[0]
max_delay = ret
for x in out[1:]:
    ret += max(0, x - max_delay) + 1
    if x > max_delay:
        max_delay = x
print(ret)

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

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

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

Solution (Python):
import math

def solve():
    num_total = int(input())
    num_transport=[0]*5
    for i in range(5):
        num_transport[i]=int(input())
    time = math.ceil(num_total/num_transport[0])
    x = num_transport[0]
    for i in range(1,5):
        if num_transport[i] < x:
            time = i+ math.ceil(num_total/num_transport[i])
            x = num_transport[i]
        else:
            time += 1
    print(time)


solve()

Solution (Python):
import sys

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    v = [int(sys.stdin.readline()) for i in range(5)]

    mi = min(v)
    ans = int((n + mi - 1) / mi)

    print(ans + 4)

Solution (Python):
import math

n = int(input())
a = [int(input()) for _ in range(5)]
min = max(a)
minin = 0
for i in range(5):
    if min > a[i]:
        min = a[i]
        minin = i
ans = math.ceil(n/a[minin]) + 4
print(ans)

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

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

print(max(math.ceil(N / a),math.ceil(N / b),math.ceil(N / c),math.ceil(N / d),math.ceil(N / e)) + 4)

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

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

min_pipe = 10**16
for pipe in pipes:
    if pipe < min_pipe:
        min_pipe = pipe

max_time, mod = divmod(N, min_pipe)
if mod != 0:
    max_time += 1

max_time += 4
print(max_time)

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

limits = list()
limits.append(a)
limits.append(b)
limits.append(c)
limits.append(d)
limits.append(e)

min_v, min_i = limits[0], 0
for i, limit in enumerate(limits):
    if min_v > limit:
        min_v = limit
        min_i = i
if min_v >= n:
    time = 5
elif n % min_v == 0:
    time = 5 + n // min_v - 1
else:
    time = 5 + n // min_v

print(time)

Solution (Python):
import math

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

Solution (Python):
def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return list(map(int, ss_raw()))


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

minimum = min([a, b, c, d, e])
ans = 5 + n // minimum
if n % minimum == 0:
    ans -= 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())

lst = [a, b, c, d, e]
v_min = min(lst)
time_slow = ceil(n/v_min)
print(4+time_slow)

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

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

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

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

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

print(max(math.ceil(N / a),math.ceil(N / b),math.ceil(N / c),math.ceil(N / d),math.ceil(N / e)) + 4)

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

mini = (-1, pow(10, 15) + 5)
for i, x in enumerate([a, b, c, d, e]):
  if mini[1] >= x:
    mini = (i, x)

if mini[1] >= n:
  print(5)
else:
  print(n // mini[1] + (1 if n % mini[1] != 0 else 0) + 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(5+math.ceil(N/M)-1)

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

print(max(math.ceil(N / a),math.ceil(N / b),math.ceil(N / c),math.ceil(N / d),math.ceil(N / e)) + 4)

Solution (Python):
import numpy as np
import sys

N = int(input())

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

width = int(A.min())

groups = N//width + int(N%width!=0)

print(groups-1+5)

Solution (Python):
lists = []
import math

N=int(input())
for _ in range(5):
    lists.append(int(input()))

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

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

mi = min(X)
result = N // mi
if N % mi != 0:
    result += 1
print(4 + result)

Solution (Python):
n=int(input())
a=[int(input()) for _ in [0]*5]
ans=10**16
ind=0
for i in range(5):
    if a[i]<ans:
        ind=i
        ans=a[i]
print(5+(n-1)//ans)

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

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

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    A = [int(input()) for _ in range(5)]

    ans = 0
    neck = min(A)

    ans += N // neck + 4
    if N % neck != 0:
        ans += 1

    return ans


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

Solution (Python):
import math

def solve():
  N = int(input())
  ABCDE = [int(input()) for i in range(5)]
  return 4 + math.ceil(N / min(ABCDE))

print(solve())

Solution (Python):
N = int(input())
x = [int(input()) for _ in range(5)]
i, m = min(enumerate(x), key = lambda y: y[1])
if m > N:
    ans = 5
elif N % m:
    ans = N // m + 5
else:
    ans = N // m + 4
print(ans)

Solution (Python):
import math
import copy
from collections import Counter
from _ast import Or
 
 
 
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:
 
            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
 
n=int(input())
a=nCast(inputArr(5))


                   
   

def func():
    mm=min(a)
    k=0
    if n%mm!=0:
        k=1
    k+=int(n/mm)+4
    return k
print(func())

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

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

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

smallest = 10 ** 15
bottle = 0
for i in range(5):
    if ts[i] < smallest:
        bottle = i
        smallest = ts[i]

total = bottle + N // smallest
if N % smallest != 0:
    total += 1
total += 4 - bottle
print(total)

Solution (Python):
N = int(input())
ABCDE = [int(input()) for i in range(5)]
key = min(ABCDE)
key = N / key + 4
if key != int(key):
    key = int(key + 1)
print(int(key))

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:
    tp = n // bn
else:
    tp = (n // bn) + 1

print(5 + tp - 1)

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

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

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

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

if N % capacity == 0:
    answer = N // capacity + 4
else:
    answer = N // capacity + 5

print(answer)

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

Solution (Python):
import math
def solve():
  n = int(input())
  a = [int(input()) for _ in range(5)]
  
  time = 0
  time += math.ceil(n/a[0])
  people = a[0]
  
  
  for i in range(1,5):
    if people <= a[i]:
      time += 1
    else:
      
      time += 1+math.ceil(n/a[i])-math.ceil(n/people)
      people = min(people,a[i])
    
  print(time)
      
    
solve()

Solution (Python):
import math

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

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

print(N // minABCDE + math.ceil((N % minABCDE) / minABCDE) + 4)

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

a_min = min(a)

ans = (N+(a_min-1))//a_min-1+5
print(ans)

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

k  = min(a)
r = 0
if n % k != 0:
    r = 1

print(5+(n//k)-1+r)

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

print(math.ceil(N/l[0])+4)

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

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

k=min(a,b,c,d,e)
print(5+n//k-(n%k==0))

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

Solution (Python):

from sys import stdin
import math


s_in = lambda: stdin.readline()[:-1]  
d_in = lambda: int(stdin.readline())  
ds_in = lambda: list(map(int, stdin.readline().split()))  

N = d_in()
max_people = []
for i in range(5):
    max_people.append(d_in())

min_p = min(max_people)
min_idx = 5
for i in range(5):
    if max_people[i] == min_p:
        min_idx = i
        break

cost = 0
cost += 4
cost += math.ceil(N / min_p)

print(cost)

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

Solution (Python):



from itertools import chain
from functools import reduce
from collections import OrderedDict, Counter, deque
import operator

IS = lambda: int(input())

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

mn = min(A)
mi = A.index(mn)
d,m = divmod(N, mn)
print(4 + d + (m != 0))

Solution (Python):
from math import ceil


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


if __name__ == "__main__":
    main()

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

for _ in range(5):
  l.append(int(input()))
neck = min(l)

group_num = n // neck if n % neck == 0 else n // neck + 1

print(4+group_num)

Solution (Python):
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

N=ri()
A=rr(5)
ma=min(A)
ans = 5+N//ma
ans -= 1 if N%ma==0 else 0
print(ans)

Solution (Python):


n = int(input())

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

minidx = 0
for i in range(5):
    if nums[i] < nums[minidx]:
        minidx = i

minnum = nums[minidx]

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

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

Solution (Python):
N = int(input())
min_p = N
for i in range(5):
    p = int(input())
    min_p = min(min_p, p)
print(N // min_p + int(bool(N % min_p)) + 4)

Solution (Python):

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

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

min_norimono = min(norimono_lis)

if n % min_norimono == 0:
    ans = (n//min_norimono) + 4
else:
    ans = (n//min_norimono) + 5
print(ans)

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

Solution (Python):

import sys
import itertools
import collections
import functools
import math
from queue import Queue

INF = float("inf")


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


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    D = int(next(tokens))  
    E = int(next(tokens))  
    solve(N, A, B, C, D, E)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
mn = int(input())
for i in range(4):
  mn = min(mn, int(input()))
if n <= mn:
  print(5)
else:
  print(5 + (n - 1) // mn)

Solution (Python):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator



inf = float('inf')
N = 0


def set_inputs():
    global N
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    
    n = get_int()
    a = get_int()
    b = get_int()
    c = get_int()
    d = get_int()
    e = get_int()
    m = min(a, b, c, d, e)
    print(5 + (n + m - 1) // m - 1)
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()

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

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

if N%min(li) != 0:
    a = N//min(li)+1
else:
    a = N//min(li)
print(4+a)

Solution (Python):


import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return int(stdin.readline())

N = li()
a = li()
b = li()
c = li()
d = li()
e = li()

bottle_neck = min([a, b, c, d, e])
red = (N - 1) // bottle_neck
print(5 + red)

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

x = - (- N // min(A, B, C, D, E))
print(5 + (x - 1))

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

min_number=min(people)
first_need=-(-n//min_number)-1
print(first_need+5)

Solution (Python):

"""
Created on Sat Apr  6 20:39:55 2019

@author: Yamazaki Kenichi
"""
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)
t = math.ceil(N/neck)

print(t + 4)

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

Solution (Python):
N = int(input())
trans = []
for i in range(5):
    trans.append(int(input()))
narrow = min(trans)
if N % narrow != 0:
    pair = N // narrow + 1
else:
    pair = N // narrow
print(str(pair+4))

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

Solution (Python):
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g




















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

mov.sort()

min = mov[0]

if min >= n:
    print(5)
else:
    if n % min != 0:
        ex = n // min
    else:
        ex = n//min -1

    print(5+ex)

Solution (Python):

import math
N = int(input())
A = [0] * 5
for i in range(len(A)):
    A[i] = int(input())
min_a = min(A)
print(math.ceil(N/min_a)+4)

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

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

x = []

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

m = min(x)

print(4+n//m+(n%m!=0))

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

n = board[0]
neck = min(board[1:])

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

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

for _ in range(5):
    time.append(int(input()))

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

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)
loss=-(-(N-x)//x)

print(max(5+loss,5))

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

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

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

min_a = min(a)
min_i = a.index(min_a)

print(4 - (-n//min_a))

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

Solution (Python):
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

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

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

ans = 5 + (n-1) // k
print(ans)

Solution (Python):
n = int(input())
s = [int(input()) for i in range(5)]
t = min(s)
a,b = divmod(n,t)
if b == 0:
    print(5 + a - 1)
else:
    print(5 + a)

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

a = min(atoe)

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

Solution (Python):
import collections as c
ip = lambda : map(int, input().split())


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

ans = 0
ans += (N+A-1)//A
bt = ans



b = A
for i in [B,C,D,E]:
    if b <= i:
        ans += 1
    else:
        b = i
        ans += (N+i-1)//i - bt +1
        bt = (N+i-1)//i
print(ans)

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

Solution (Python):
import math

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

mi = d[0]
Ans = math.ceil(N / mi)
for i in d[1:]:
  Ans += 1
  if i < mi:
    x = math.ceil(N / i) - math.ceil(N / mi)
    Ans += x
    mi = i   

print(Ans)

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

ans = 0

ans += N // min(L)
if N % min(L) != 0 :
    ans += 1
ans += 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())
print(math.ceil(N / min(A, B, C, D, E)) + 4)

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

def f(a):
    if n%a==0:
        return n//a
    else:
        return n//a+1
l=[]
for i in [a,b,c,d,e]:
    l.append(f(i))

print(max(l)+4)

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


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

Solution (Python):


if __name__ == '__main__':
    N = int(input())
    a = []
    for i in range(5):
        a.append(int(input()))
    m = min(a)
    s = N // m + 4
    if N % m != 0:
        s += 1
    print(s)

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

Solution (Python):
import math

N = int(input())
m = 1<<50
for _ in range(5):
    tmp = int(input())
    m = min(m, tmp)

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

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

Solution (Python):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
L = (A, B, C, D, E)
m = min(L)
print((N + m - 1) // m + 4)

Solution (Python):

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

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

Solution (Python):
import math
import sys

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

m=min(a)

tmp=-1
for i in range(5):
    if a[i]==m: p=i


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

Solution (Python):
import itertools

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

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

if r >= n:
    print(5)
else:
    loss = n // r

    if n % r != 0:
        loss += 1
        
    print(loss + 4)

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

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

import math

ans = max(5, math.ceil(n/min(a))+4)
print(ans)

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

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

Solution (Python):
from math import ceil


def five_transportations(N: int, A: int, B: int, C: int, D: int, E: int)->int:
    return 5 + ceil(N / min(A, B, C, D, E)) - 1


if __name__ == "__main__":
    inputs = [int(input()) for _ in range(6)]
    N, A, B, C, D, E = inputs
    ans = five_transportations(N, A, B, C, D, E)
    print(ans)

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

minA = min(ABCDEs)

ans = -(- N // minA) + 4
print(ans)

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

neck_idx = -1
neck = -1
for i in range(5):
    if min(A) == A[i]:
        neck_idx = i
        neck = A[i]
        break

x = N // neck
if N % neck > 0:
    x += 1

print(x + 4)

Solution (Python):
A=[]
for i in range(6):
  A.append(int(input()))
x=min(A[1:])
ans=A[0]//x
ans+=1 if A[0]%x!=0 else 0
print(ans+4)