using static System.Math; using System.Collections.Generic; using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var m = int.Parse(line[1]); if (m == 0) { Console.WriteLine(n); goto exit; } line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, int.Parse); getAns(n, a); exit:; } static void getAns(int n, int[] a) { var f = new bool[n + 1]; foreach (var x in a) f[x] = true; var count = 0; for (int i = n; i >= 1; i--) { if (!f[i]) { count++; continue; } foreach (var x in getDiv(i)) f[x] = f[x] ? false : true; } Console.WriteLine(count); } static List getDiv(int n) { var ans = new List(); for (int i = 1; i <= Sqrt(n); i++) { if (n % i == 0) { ans.Add(i); if (n != i * i) ans.Add(n / i); } } return ans; } }