using System; using System.Linq; class Program { static void Main() { var N = int.Parse(Console.ReadLine()); var nums = Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToArray(); int numCount; if (nums.Any(n => n == 1)) numCount = N; else { numCount = nums.Distinct() .SelectMany(n => Enumerable.Range(1, N / n).Select(m => n * m) ).Distinct() .Count(); } Console.WriteLine(numCount); } }