n,m = map(int,input().split()) a = list(map(int,input().split())) g = [0] * (n+1) for i in range(m): g[a[i]] = 1 boo = [1] * (n+1) #サボったら0 ans = 0 for i in range(n,0,-1): coef = 1 cnt = 0 while i * coef <= n: cnt += boo[i * coef] coef += 1 if cnt%2 != g[i]: boo[i] = 0 ans += 1 print(ans)