N,M = map(int, input().split()) A = list(map(int, input().split())) L = [0]*(N+1) DOOR = [0]*(N+1) for i in range(1,N+1): for j in range(i,N+1,i): L[j] = (L[j]+1)%2 for a in A: DOOR[a]=1 cnt = 0 for i in range(N+1): if L[i]!=DOOR[i]: cnt+=1 for j in range(i,N+1,i): DOOR[j]=(DOOR[j]+1)%2 print(cnt)