n,m=map(int,input().split()) a=list(map(int,input().split())) lis=[1]*(n+1) def make_divisors(n): lower_divisors,upper_divisors=[],[] i=1 while i*i<=n: if n%i==0: lower_divisors.append(i) if i!=n//i: upper_divisors.append(n//i) i+=1 return lower_divisors+upper_divisors[::-1] for i in range(1,n+1): div=make_divisors(i) for num in div: lis[num]=1-lis[num] lis2=[1]*(n+1) for i in range(m): lis2[a[i]]=0 ans=0 for i in range(n,0,-1): if lis[i]!=lis2[i]: ans+=1 l=make_divisors(i) for j in l: lis[j]=1-lis[j] else: continue print(ans)