N,M = map(int,input().split()) A = list(map(int,input().split())) s = set(A) dat = [0] * (N + 1) div = [[] for _ in range(N + 1)] for i in range(1,N + 1): for j in range(i,N + 1,i): div[j].append(i) ans = 0 for i in range(N,0,-1): if dat[i] == 0 and i not in s: ans += 1 continue if dat[i] == 1 and i in s: ans += 1 continue for j in div[i]: dat[j] ^= 1 print(ans)