n = int(input().split()[0])
c = list(map(int,input().split()))
minimum = [ i for i in range(n+1) ]

for i in range(2,n+1):
    for j in c:
        if j <= i and minimum[i-j] + 1 < minimum[i]:
            minimum[i] = minimum[i-j]+1

print(minimum[n]) n = int(input().split()[0]) n int(input().split()[0]) int input().split()[0] ().split() ().split () input split 0 c = list(map(int,input().split())) c list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split i for i in range(n+1) for i in range(n+1) i range(n+1) range n+1 n 1 for i in range(n+1) i minimum = [ i for i in range(n+1) ] minimum [ i for i in range(n+1) ] for i in range(2,n+1):
    for j in c:
        if j <= i and minimum[i-j] + 1 < minimum[i]:
            minimum[i] = minimum[i-j]+1 i range(2,n+1) range 2 n+1 n 1 for j in c:
        if j <= i and minimum[i-j] + 1 < minimum[i]:
            minimum[i] = minimum[i-j]+1 j c if j <= i and minimum[i-j] + 1 < minimum[i]:
            minimum[i] = minimum[i-j]+1 j <= i and minimum[i-j] + 1 < minimum[i] j <= i j i minimum[i-j] + 1 < minimum[i] minimum[i-j] + 1 minimum[i-j] minimum i-j i j 1 minimum[i] minimum i minimum[i] = minimum[i-j]+1 minimum[i] minimum i minimum[i-j]+1 minimum[i-j] minimum i-j i j 1 print(minimum[n]) print minimum[n] minimum n n = int(input().split()[0]) int(input().split()[0]) n minimum = [ i for i in range(n+1) ] [ i for i in range(n+1) ] minimum c = list(map(int,input().split())) list(map(int,input().split())) c
n = int(input().split()[0])
c = list(map(int,input().split()))
minimum = [ i for i in range(n+1) ]

for i in range(2,n+1):
    for j in c:
        if j <= i and minimum[i-j] + 1 < minimum[i]:
            minimum[i] = minimum[i-j]+1

print(minimum[n])