#include using namespace std; #define ALL(obj) (obj).begin(), (obj).end() #define rALL(obj) (obj).rbegin(), (obj).rend() using ll = long long; const int INF = 1 << 30; int main() { int N, M; cin >> N >> M; vector locker(N), open(N); for (int i = 0; i < M; i++) { int A; cin >> A; A--; open[A]++; } int ans = 0; for (int i = N; i > 0; i--) { if(open[i-1] == locker[i-1]) { ans++; continue; } locker[i-1]++; locker[i-1] %= 2; for (int j = 1; j*j <= i; j++) { if(i%j) continue; locker[j-1]++; locker[j-1] %= 2; if(i/j != i) { locker[i/j -1]++; locker[i/j -1] %= 2; } } } cout << ans << endl; return 0; }