n, m = map(int, input().split())
dp = [0]+[float("inf")]*n
for coin in map(int, input().split()):
    for i, j in zip(range(n), range(coin, n+1)):
        dp[j] = min(dp[i]+1, dp[j])
print(dp[n]) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m dp = [0]+[float("inf")]*n dp [0]+[float("inf")]*n [0] 0 [float("inf")]*n [float("inf")] float("inf") float "inf" n for coin in map(int, input().split()):
    for i, j in zip(range(n), range(coin, n+1)):
        dp[j] = min(dp[i]+1, dp[j]) coin map(int, input().split()) map int input().split() ().split () input split for i, j in zip(range(n), range(coin, n+1)):
        dp[j] = min(dp[i]+1, dp[j]) i j zip(range(n), range(coin, n+1)) zip range(n) range n range(coin, n+1) range coin n+1 n 1 dp[j] = min(dp[i]+1, dp[j]) dp[j] dp j min(dp[i]+1, dp[j]) min dp[i]+1 dp[i] dp i 1 dp[j] dp j print(dp[n]) print dp[n] dp n dp = [0]+[float("inf")]*n [0]+[float("inf")]*n dp n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m
n, m = map(int, input().split())
dp = [0]+[float("inf")]*n
for coin in map(int, input().split()):
    for i, j in zip(range(n), range(coin, n+1)):
        dp[j] = min(dp[i]+1, dp[j])
print(dp[n])
