n,*a=eval('int(input()),'*6);print((4--n//min(a)))
n,*a=list(map(int,open(0)));print((4--n//min(a)))
n, *a = eval("int(input())," * 6)
print((4 - -n // min(a)))

n, *a = list(map(int, open(0)))
print((4 - -n // min(a)))

-n, *a = eval("int(input())," * 6) +n, *a = list(map(int, open(0)))