/** * @FileName a.cpp * @Author kanpurin * @Created 2022.05.20 22:18:18 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n,m;cin >> n >> m; vector b(n+1); for (int i = 0; i < m; i++) { int a;cin >> a; b[a] = 1; } int ans = 0; for (int i = 1; i <= n; i++) { if (b[i] == 0) { ans++; } else { for (int j = i; j <= n; j+=i) { b[j] = 1-b[j]; } } } cout << ans << endl; return 0; }