class osa_k: min_factor = [] def __init__(self, n): self.min_factor = list(range(n + 1)) i = 2 while i * i <= n: if self.min_factor[i] < i: i += 1 continue for j in range(i*i, n + 1, i): if self.min_factor[j] == j: self.min_factor[j] = i i += 1 def factor(self, n): res = [] while n > 1: res.append(self.min_factor[n]) n //= self.min_factor[n] return res def divisors(self, n): res = [1] while n > 1: x = self.min_factor[n] cnt = 0 while n % x == 0: cnt += 1 n //= x t = [] p = 1 for i in range(cnt + 1): for j in range(len(res)): t.append(res[j] * p) p *= x res = t[:] return res osk = osa_k(200000) n, m = map(int, input().split()) d = [0] * (n + 1) d2 = [0] * (n + 1) a = list(map(int, input().split())) for x in a: d2[x] = 1 for i in range(1, n + 1): d[i] = (n // i) % 2 ans = 0 for i in range(n, 0, -1): if d[i] != d2[i]: ans += 1 for dv in osk.divisors(i): d[dv] ^= 1 print(ans)