#include using namespace std; using ll = long long; int main(){ ll N, M, c, ans=0; cin >> N >> M; vector cnt(N+1), open(N+1); for (int i=1; i<=M; i++){ cin >> c; open[c] = 1; } for (int i=1; i<=N; i++){ if (open[i] != (cnt[i]+1) % 2) ans++; else for (int j=i; j<=N; j+=i) cnt[j]++; } cout << ans << endl; return 0; }