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-----
5
3
2
4
3
5

-----Sample Output-----
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.

Difficulty: introductory

Starter code:

Solutions:
#70 C - Five Transportations
N = int(input())
lis = [int(input()) for _ in range(5)]
mini = min(lis)
group = (N+mini-1)//mini

ans = 5 + group - 1
print(ans)

import math
N = int(input())
p = [0] * 5
bn = float('inf')
for i in range(5):
  p[i] = int(input())
  if bn > p[i]:
    bn = p[i]
ans = 0
print((math.ceil(N / bn) + (5 - 1)))


import math

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

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

print(ans)

import math

N=int(input())
A=[int(input()) for _ in range(5)]
n=min(A)
for i in range(5):
  if n==A[i]:
    p=i
    break
k=math.ceil(N/n)
print(k+4)

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) if n%min(a,b,c,d,e)==0 else print((n//min(a,b,c,d,e)+1)+4)



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

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

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

print(4-(-n//min(abcde)))

import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
move = [a, b, c, d, e]
f = min(a, b, c, d, e)
f_index = move.index(f)+1

print(math.ceil(n/f) + (5-f_index) + f_index-1)

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

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

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

n = int(input())
a = list(int(input()) for _ in range(5))
Min = min(a)

if n <= Min:
    print(5)
    return

x = n//Min
if n%Min != 0: x += 1
print(4-a.index(Min)+x+a.index(Min))

import math
N = int(input())
move = []
for i in range(5):
    move.append(int(input()))
movemin=min(move)
if movemin>=N:
    ans=5
else:
    ans=(math.ceil(N/movemin))+4

print(ans)


import math
N = int(input())
mobile = [int(input()) for _ in range(5)]

res = math.ceil(N/min(mobile)) + 4

print(res)

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


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

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

import math

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])
_ans = math.ceil(n/_min)

print(_ans+4)

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

n,*a = [int(input()) for _ in range(6)]
print(((n+min(a)-1)//min(a)+4))

import math


def main():
    n = int(input())
    csr = []
    for _ in range(5):
        csr.append(int(input()))
    # print(5+n//min(csr))
    print((4+math.ceil(n/min(csr))))


def __starting_point():
    main()

__starting_point()

from math import ceil

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

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


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

from math import ceil
t = min(T)
print(ceil(N/t) + 4)

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

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

n = int(input())
tp = []
tmp = 10**15
for _ in range(5):
    a = int(input())
    if tmp > a:
        tmp = a
    tp.append(a)

if tmp >= n:
    print(5)
    return

cnt = n//tmp
mod = n%tmp

if mod > 0:
    print(5+cnt)
else:
    print(5+cnt-1)

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)

# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(N, A, B, C, D, E):
    tmp = min(A, B, C, D, E)
    tmp, tmp2 = divmod(N, tmp)
    tmp += 0 if tmp2 == 0 else 1
    print((tmp + 4))


def __starting_point():
    N = int(input())
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    solve(N, A, B, C, D, E)

    # # test
    # from random import randint
    # from func import random_str
    # solve()

__starting_point()

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

if n % min(a) != 0:
    n += min(a) - (n % min(a))

if min(a) >= n:
    print((5))
else:
    print((int(n/min(a)) + 4))


N, A, B, C, D, E = [int(input()) for _ in range(6)]
 
# 1 => 2: A
# 2 => 3: B
# 3 => 4: C
# 4 => 5: D
# 5 => 6: E

# ボトルネックが全体を支配する！
# 最初からボトルネックの速度で移動するとしてOK
ans = -(-N // min(A, B, C, D, E)) + 4
print(ans)

n=int(input())
from math import ceil
a,b,c,d,e=[int(input()) for i in range(5)]
print(max( ceil(n/a),ceil(n/b),ceil(n/c),ceil(n/d),ceil(n/e), )+4)

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

if N%min(li)==0:
    a=N//min(li)-1
else:
    a=N//min(li)
ans=5+a

print(ans)


import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = list(map(int, read().split()))

    ans = 0
    for i in range(5):
        res = (N + A[i] - 1) // A[i] + 4
        if ans < res:
            ans = res

    print(ans)
    return


def __starting_point():
    main()

__starting_point()

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

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

n = int(input())

x = float('inf')
for _ in range(5):
    a = int(input())
    x = min(x,a)

print((n-1)//x + 5)

'''
Created on 2020/08/30

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=int(pin())
  A=int(pin())
  B=int(pin())
  C=int(pin())
  D=int(pin())
  E=int(pin())
  
  t=min(A,B,C,D,E)
  if N%t==0:
    print(N//t+4)
  else:
    print(N//t+5)
  return 
main()

n=int(input())
t=[int(input()) for i in range(5)]
k=0
for i in range(5):
    k=max(k,(n+t[i]-1)//t[i])
print(k+4)

import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    L = [I() for i in range(5)]
    print(math.ceil(N / min(L) + 4))

def __starting_point():
    main()
__starting_point()

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


print(5+(n-1)//min([a,b,c,d,e]))

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

mi = min(l)

print((n+mi-1)//mi+4)

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

a, b = divmod(n, x)
if b == 0:
    print((5+(a-1)))
else:
    print((5+a))


from math import *

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

ans = ceil(n / a[0])
min = 0
for i in range(1, 5):
  if a[i] >= a[min]:
    ans += 1
  else:
    ans = ceil(n / a[i]) + i
    min = i

print(ans)

from math import *

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


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

# -*- coding: utf-8 -*-
"""
Created on Sat Sep 12 23:38:36 2020

@author: liang
"""

N = int(input())
cost = [int(input()) for _ in range(5)]
cost.sort()
if N%cost[0] == 0:
    ans = 4 + N//cost[0] 
else:
    ans = 4 + N//cost[0] + 1
print(ans)

a = [int(input()) for i in range(6)]
mi=min(a)
if(a[0]==mi):print(5)
else: 
    if(a[0]%mi==0): print(5+a[0]//mi-1)
    else: print(5+a[0]//mi)

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


import math
a = int(input())
b = []
for i in range(5):
  b.append(int(input()))
c = min(b)
d = math.ceil(a/c)
print((d+4))
  


import math
members = 0
min_value = 10**16
for i in range(6):
    if i == 0:
        members = int(input())
    else:
        current = int(input())
        if current < min_value:
            min_value = current
counter = math.ceil(members / min_value)
counter += 4
print(counter)


# author:  Taichicchi
# created: 28.09.2020 00:14:38

import sys
from math import ceil
n = int(input())
m = 10 ** 18
for i in range(5):
    m = min(m, int(input()))

print((ceil(n / m) + 4))


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


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

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

f=lambda:int(input())
N=f()
D=[0]*5
for i in range(5):
    D[i]=f()

m=min(D)
g=-(-(N-m)//m)

print(5+g)

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

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

n = int(input())
time = [int(input()) for _ in range(5)]
count = 0
if all([i >= n for i in time]):
    print((5))
else:
    smallest = min(time)
    smallest_index = time.index(smallest)
    count += n // smallest
    if n % smallest != 0:
        count += 1
    print((count + 4)) 


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

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

minA = min(A)

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

import math

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

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


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

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

n = int(input())
gates = [int(input()) for _ in range(5)]
bn = min(gates)

print((int((n + bn - 1) / bn) + 4))


import math

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


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

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

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

def main():
    n = int(input())
    data = [int(input()) for i in range(5)]
    quo, rem = divmod(n, min(data))
    quo = 5 + quo
    if rem:
        print(quo)
    else:
        print(quo - 1)

main()

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

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

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
from math import ceil
a = ceil(N/A)
F = [A,B,C,D,E]
for i in range(1,5):
    if F[i-1] <= F[i]:
        a += 1
    else:
        b = ceil(N/F[i])
        a = max(a+1,b+i)
print(a)

def main():
    n = int(input())
    data = [int(input()) for i in range(5)]
    quo, rem = divmod(n, min(data))
    print(4 + quo + bool(rem))


main()

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

print(((N + min(T) - 1) // min(T) + 4))


n = int(input())
x = [int(input()) for _ in range(5)]
cap = min(x)
ans = (n+cap-1) // cap + 4
print(ans)


n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
    
aa = -(-n//a)
bb = -(-n//b)
cc = -(-n//c)
dd = -(-n//d)
ee = -(-n//e)

print(max(aa,bb,cc,dd,ee)+4)

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

"""
people_num=int(input(''))
time_sum=0
num_trans=[]

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

location=[[people_num,0,0,0,0,0]]

while location[0][5]<people_num:
    location_old=location.pop(0)
    print(location_old)
    location_new=[0,0,0,0,0,location_old[5]]
    print("step0")
    for i in range(5):
        if location_old[i]>num_trans[i]:
            location_new[i+1]+=num_trans[i]
            location_new[i]+=location_old[i]-num_trans[i]
        else:
            location_new[i+1]+=location_old[i]
    time_sum+=1
    location.append(location_new)
    print("step2")
print(str(time_sum))

↑失敗version
"""

"""
解説

最も通りにくい、つまり容量が最も小さい交通機関を考えます。直感的には、最短時間で移動する場
合でも、1 分でたどり着けるのは 𝑋 人 (交通機関の容量の最小を 𝑋 とする) になります。これは、「1
秒に 15 L のペースで水を送れるポンプと、1 秒に 12 L のペースで水を送れるポンプをつなげたときに、
1 秒に送れる水の量は小さい方を取って 12 L」 になるのと同じ原理です。
つまり、先ほどの貪欲的な方法ではなくて、1 分に 𝑋 人ずつ 1 つ先に進めてやっても、直感的には
かかる時間は変わらなさそうです。また、移動時間は 「(𝑁 ÷ 𝑋 を切り上げた値) + 4 分」 と、簡単に
計算できるようになります。
"""
import math

people_num=int(input(''))
num_trans=[]

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

print(math.ceil(people_num/min(num_trans)+4))

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

min_capa = min(capa)
if min_capa>=n:
    print(5)

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

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

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


import math

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

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

N = int(input())
A = [int(input()) for i in range(5)] #A[i]:amount of people able to be carried at once from i to i+1
B = [0] * 6 #B[i]:amount of people at i now 
cnt = 0

#max people able to be transported in m minutes
P = [0] * 9
B[0] = 10**15
for m in range(9):
    for i in range(5,0,-1):
        B[i] += min(A[i-1],B[i-1])
        B[i-1] -= min(A[i-1],B[i-1])
        
    P[m] = B[5]
    cnt += 1
#print(P)
x = N // P[-1]
y = N % P[-1]
if y == 0:
    print((5*x+4))
    return
for j in range(7,2,-1):
    if P[j]<y:
        time = 5 * x + j + 2
        print(time)
        return
        


n, a, b, c, d, e = [int(input()) for _ in range(6)]
minVal = min(a, b, c, d, e)
if n // minVal == n / minVal:
    ans = n // minVal + 4
else:
    ans = (n // minVal + 1) + 4
print(ans)

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)

import math
import numpy as np
N,*T = list(map(int,open(0).read().split()))

X = np.array(T).min()

print((4+math.ceil(N/float(X))))


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

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

min_value = min(move)
group_count = -(-N // min_value)

# 最後のグループが出発するまでの値はgroup_count - 1
print((group_count - 1 + 5))


import math
N = int(input())
X = [int(input()), int(input()), int(input()), int(input()), int(input())]

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


import sys
import math

n = int(input())

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

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


n=int(input())
a=[]
#r=0
import math
a.append(math.ceil(n/int(input())))
a.append(math.ceil(n/int(input())))
a.append(math.ceil(n/int(input())))
a.append(math.ceil(n/int(input())))
a.append(math.ceil(n/int(input())))

print(max(a)+5-1)

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

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

N = int(input())
A = [int(input()) for _ in range(5)]
 
# 一番輸送量が小さい経路で詰まる
# 一番輸送量が小さい経路を一番最初に通過すると考える
ans = -(-N // min(A)) + 4
print(ans)

#!/usr/bin/env python3

#import
import math
#import numpy as np
N = int(input())
A = [int(input()) for _ in range(5)]

a = min(A)

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


import math

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

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

from math import ceil


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


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


N=int(input())

capa=[int(input()) for _ in range(5)]
for i in range(5):
	if capa[i]==min(capa):
		transmin=i

#print(N//capa[transmin],transmin)
			
if capa[transmin]>=N:
	print((5))
else:
	if N%capa[transmin]==0:
		print((transmin+N//capa[transmin]+4-transmin))
	else:
		print((transmin+N//capa[transmin]+1+4-transmin))



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

N, *capas = list(map(int, open(0).read().split()))
min_capa = min(capas)
print(((N + min_capa - 1) // min_capa + 4))


N, A, B, C, D, E = [int(input()) for _ in range(6)]
 
# 1 => 2: A
# 2 => 3: B
# 3 => 4: C
# 4 => 5: D
# 5 => 6: E
 
ans = -(-N // min(A, B, C, D, E)) + 4
print(ans)

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)