N, K = map(int, input().split()) A = list(map(int, input().split())) S = set(A) sabo = [0] * (N + 1) for i in reversed(range(1, N+1)): c = (N // i) % 2 for j in range(i, N+1, i): c ^= sabo[j] if i in S and c == 1: continue if not i in S and c == 0: continue sabo[i] = 1 print(sum(sabo))