#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // #include using ll = long long; using ld = long double; using namespace std; // using namespace atcoder; using P = pair; using Graph = vector>; using Priority = priority_queue, greater>;// 昇順 using Priority_pair = priority_queue, greater

>; // using mint_17 = modint1000000007; // using mint = modint998244353; #define mod 1000000007 #define MAX_WIDTH 60 #define MAX_HEIGHT 60 #define INF 1e18 #define MOD 998244353 #define PI 3.141592653589793 #define rep(i, a, b) for(ll i=(a);i<(b);i++) #define rrep(i, a, b) for(ll i=(a);i>=(b);i--) #define fore(i, a) for(auto &i: a) #define all(v) (v).begin(), (v).end() #define YES(a) cout << ((a) ? "YES" : "NO") << endl #define Yes(a) cout << ((a) ? "Yes" : "No") << endl #define pb(a) push_back(a) #define vi vector #define vll vector #define vs vector #define vc vector #define vp vector> #define mll map #define msl map #define COUT(n) cout << (n) << endl #define isInGrid(n, h, w) (0 <= (n) && (n) < (h) && 0 <= (n) && (n) < (w)) template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int vx[] = {1,0,-1,0}, vy[] = {0,1,0,-1}; ll N, M, A[200010]; ll cnt[200010]; bool is_open[200010]; void enum_divisors(long long N) { for (long long i = 1; i * i <= N; ++i) { if (N % i == 0) { cnt[i]++; cnt[i]%=2; // 重複しないならば i の相方である N/i も push if (N/i != i) { cnt[N/i]++; cnt[N/i]%=2; } } } } void enum_divisors2(long long N) { for (long long i = 1; i * i <= N; ++i) { if (N % i == 0) { if(cnt[i] == 1) { cnt[i]--; } else { cnt[i] = 1; } if (N/i != i) { if(cnt[N/i] == 1) { cnt[N/i]--; } else { cnt[N/i] = 1; } } } } } int main() { cin >> N >> M; rep(i, 0, M) { cin >> A[i]; is_open[A[i]] = true; } rep(i, 0, N+1) cnt[i] = 0; rep(i, 1, N+1) { enum_divisors(i); } // 0 close 1 open ll ans = 0; for(int i=N;i>0;i--) { if((is_open[i] && cnt[i] == 0) || (!is_open[i] && cnt[i] == 1)) { enum_divisors2(i); ans++; } } COUT(ans); return 0; }