n =int(input().split()[0])
m = map(int, input().split())

c = [ i for i in range(n+1) ]
coins = []

for coin in m:
    if coin <= n:
        c[coin] = 1
        coins.append(coin)

for p in range(2,n+1):
    minc = c[p]
    if minc <= 2:
        continue
    for coin in coins:
        if p > coin:
            if minc > c[p-coin]+1:
                minc = c[p-coin]+1
    c[p] = minc

print(c[n]) n =int(input().split()[0]) n int(input().split()[0]) int input().split()[0] ().split() ().split () input split 0 m = map(int, input().split()) m 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 c = [ i for i in range(n+1) ] c [ i for i in range(n+1) ] coins = [] coins [] for coin in m:
    if coin <= n:
        c[coin] = 1
        coins.append(coin) coin m if coin <= n:
        c[coin] = 1
        coins.append(coin) coin <= n coin n c[coin] = 1 c[coin] c coin 1 coins.append(coin) coins.append coins append coin for p in range(2,n+1):
    minc = c[p]
    if minc <= 2:
        continue
    for coin in coins:
        if p > coin:
            if minc > c[p-coin]+1:
                minc = c[p-coin]+1
    c[p] = minc p range(2,n+1) range 2 n+1 n 1 minc = c[p] minc c[p] c p if minc <= 2:
        continue
     minc <= 2 minc 2 continue for coin in coins:
        if p > coin:
            if minc > c[p-coin]+1:
                minc = c[p-coin]+1
     coin coins if p > coin:
            if minc > c[p-coin]+1:
                minc = c[p-coin]+1
     p > coin p coin if minc > c[p-coin]+1:
                minc = c[p-coin]+1
     minc > c[p-coin]+1 minc c[p-coin]+1 c[p-coin] c p-coin p coin 1 minc = c[p-coin]+1 minc c[p-coin]+1 c[p-coin] c p-coin p coin 1 c[p] = minc c[p] c p minc print(c[n]) print c[n] c n coins = [] [] coins minc = c[p] c[p] minc minc = c[p-coin]+1 c[p-coin]+1 minc m = map(int, input().split()) map(int, input().split()) m n =int(input().split()[0]) int(input().split()[0]) n c = [ i for i in range(n+1) ] [ i for i in range(n+1) ] c
n =int(input().split()[0])
m = map(int, input().split())

c = [ i for i in range(n+1) ]
coins = []

for coin in m:
    if coin <= n:
        c[coin] = 1
        coins.append(coin)

for p in range(2,n+1):
    minc = c[p]
    if minc <= 2:
        continue
    for coin in coins:
        if p > coin:
            if minc > c[p-coin]+1:
                minc = c[p-coin]+1
    c[p] = minc

print(c[n])