fn main() { let (n, _m) = { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( iter.next().unwrap().parse::().unwrap(), iter.next().unwrap().parse::().unwrap(), ) }; let aa = { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.split_whitespace() .map(|x| x.parse::().unwrap()) .collect::>() }; let mut actual = vec![false; n + 1]; for &a in aa.iter() { actual[a] = true; } let mut ans = 0_u32; let mut lockers = vec![false; n + 1]; for i in 1..=n { if lockers[i] == actual[i] { ans += 1; } else { for j in (i..=n).step_by(i) { lockers[j] = !lockers[j]; } } } println!("{}", ans); }