#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); vector> div(N+1); for (int i=1; i<=N; i++){ for (int j=i; j<=N; j+=i) div[j].push_back(i); } for (int i=1; i<=M; i++){ cin >> c; open[c] = 1; } for (int i=N; i>=1; i--){ if (open[i] != (cnt[i]+1) % 2) ans++; else for (auto x : div[i]) cnt[x]++; } cout << ans << endl; return 0; }