from math import sqrt def Divisor(N): ret = [] for i in range(1,int(sqrt(N))+1): if N % i == 0: ret.append(i) if N // i != i: ret.append(N//i) return ret N,M = map(int,input().split()) A = list(map(int,input().split())) Locker = [0] * (N+1) for a in A: Locker[a] = 1 Flg = [0] * (N+1) ans = 0 for i in range(N,0,-1): if Flg[i] == Locker[i]: ans += 1 else: P = Divisor(i) for p in P: Flg[p] ^= 1 print(ans)