#!/usr/bin/env PyPy3 from collections import Counter, defaultdict, deque import itertools import re import math from functools import reduce import operator import bisect from heapq import * import functools mod=998244353 import sys input=sys.stdin.readline n,m=map(int,input().split()) a=list(map(int,input().split())) open = [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) fact = [0] * (n+1) for aa in a: fact[aa] = 1 ans = n for i in range(1,n+1)[::-1]: if fact[i] != open[i]: ans -= 1 for j in div[i]: open[j] ^= 1 print(ans)