#include using namespace std; using ll = long long; using pll = pair; #define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i) #define rep(i, n) drep(i, 0, n - 1) #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second const ll MOD = 1000000007; const ll MOD2 = 998244353; const ll INF = 1LL << 60; const ll N_MAX = 2e5; int main(){ ll n, m; cin >> n >> m; vector isOpen(n+1, false); rep(i, m){ ll a; cin >> a; isOpen[a] = true; } vector> mul(n+1); for(ll i=1; i<=n; i++){ for(ll j=i; j<=n; j+=i){ mul[j].pb(i); } } ll ans = 0; vector cnt(n+1, 0); for(ll i=n; i>=1; i--){ if(cnt[i]%2 == isOpen[i]){ ans++; }else{ for(ll j : mul[i]){ cnt[j]++; } } } cout << ans << endl; }