nm = raw_input().split()
n = int(nm[0])
m = int(nm[1])
d = raw_input().split()

c = [0] * 100000
c[0] = 0

for i in range(n):
    min = 100000
    for j in range(m):
        if int(d[j]) < i + 2:
            x = c[i + 1 - int(d[j])]
            if x < min:
                min = x
    c[i + 1] = min + 1

print c[n] nm = raw_input().split() nm raw_input().split() ().split () raw_input split n = int(nm[0]) n int(nm[0]) int nm[0] nm 0 m = int(nm[1]) m int(nm[1]) int nm[1] nm 1 d = raw_input().split() d raw_input().split() ().split () raw_input split c = [0] * 100000 c [0] * 100000 [0] 0 100000 c[0] = 0 c[0] c 0 0 for i in range(n):
    min = 100000
    for j in range(m):
        if int(d[j]) < i + 2:
            x = c[i + 1 - int(d[j])]
            if x < min:
                min = x
    c[i + 1] = min + 1 i range(n) range n min = 100000 min 100000 for j in range(m):
        if int(d[j]) < i + 2:
            x = c[i + 1 - int(d[j])]
            if x < min:
                min = x
     j range(m) range m if int(d[j]) < i + 2:
            x = c[i + 1 - int(d[j])]
            if x < min:
                min = x
     int(d[j]) < i + 2 int(d[j]) int d[j] d j i + 2 i 2 x = c[i + 1 - int(d[j])] x c[i + 1 - int(d[j])] c i + 1 - int(d[j]) i + 1 i 1 int(d[j]) int d[j] d j if x < min:
                min = x
     x < min x min min = x min x c[i + 1] = min + 1 c[i + 1] c i + 1 i 1 min + 1 min 1 print c[n] c n d = raw_input().split() raw_input().split() d c = [0] * 100000 [0] * 100000 c min = 100000 100000 min n = int(nm[0]) int(nm[0]) n m = int(nm[1]) int(nm[1]) m nm = raw_input().split() raw_input().split() nm x = c[i + 1 - int(d[j])] c[i + 1 - int(d[j])] x min = x x min
nm = raw_input().split()
n = int(nm[0])
m = int(nm[1])
d = raw_input().split()

c = [0] * 100000
c[0] = 0

for i in range(n):
    min = 100000
    for j in range(m):
        if int(d[j]) < i + 2:
            x = c[i + 1 - int(d[j])]
            if x < min:
                min = x
    c[i + 1] = min + 1

print c[n]