length, t = map(int, input().split(" "))
target = [int(n) for n in input().split(" ")]
dp = [float("inf") for n in range(length + 1)]
dp[0] = 0
for i, coin in enumerate(target):
    for j in range(length):
        if coin + j <= length:
            dp[coin + j] = min(dp[coin + j], dp[j] + 1)
print(dp[length]) length, t = map(int, input().split(" ")) length map(int, input().split(" ")) map int input().split(" ") ().split () input split " " t int(n) for n in input().split(" ") for n in input().split(" ") n input().split(" ") ().split () input split " " for n in input().split(" ") int(n) int n target = [int(n) for n in input().split(" ")] target [int(n) for n in input().split(" ")] float("inf") for n in range(length + 1) for n in range(length + 1) n range(length + 1) range length + 1 length 1 for n in range(length + 1) float("inf") float "inf" dp = [float("inf") for n in range(length + 1)] dp [float("inf") for n in range(length + 1)] dp[0] = 0 dp[0] dp 0 0 for i, coin in enumerate(target):
    for j in range(length):
        if coin + j <= length:
            dp[coin + j] = min(dp[coin + j], dp[j] + 1) i coin enumerate(target) enumerate target for j in range(length):
        if coin + j <= length:
            dp[coin + j] = min(dp[coin + j], dp[j] + 1) j range(length) range length if coin + j <= length:
            dp[coin + j] = min(dp[coin + j], dp[j] + 1) coin + j <= length coin + j coin j length dp[coin + j] = min(dp[coin + j], dp[j] + 1) dp[coin + j] dp coin + j coin j min(dp[coin + j], dp[j] + 1) min dp[coin + j] dp coin + j coin j dp[j] + 1 dp[j] dp j 1 print(dp[length]) print dp[length] dp length target = [int(n) for n in input().split(" ")] [int(n) for n in input().split(" ")] target length, t = map(int, input().split(" ")) map(int, input().split(" ")) length dp = [float("inf") for n in range(length + 1)] [float("inf") for n in range(length + 1)] dp t = map(int, input().split(" ")) map(int, input().split(" ")) t
length, t = map(int, input().split(" "))
target = [int(n) for n in input().split(" ")]
dp = [float("inf") for n in range(length + 1)]
dp[0] = 0
for i, coin in enumerate(target):
    for j in range(length):
        if coin + j <= length:
            dp[coin + j] = min(dp[coin + j], dp[j] + 1)
print(dp[length])
