#include #include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); uint32_t N, M, i, j; cin >> N >> M; vector A(M); for (i = 0; i != M; ++i) cin >> A[i]; vector result(N, false); for (i = 0; i != M; ++i) result[A[i] - 1] = true; vector is_skipped(N, false); uint32_t ans = 0; for (i = N; i != 0; --i) { uint32_t skip_count = 0; for (j = i * 2; j <= N; j += i) if (is_skipped[j - 1]) ++skip_count; if (((N / i - skip_count) & 1) != result[i - 1]) is_skipped[i - 1] = true, ++ans; } cout << ans << '\n'; return 0; }