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(); var minNum = nums.Min(); var numCount = Enumerable.Range(minNum, N - minNum + 1) //最低数からNまでの数字のシーケンスを作る .Count(n => nums.Any(a => n % a == 0)); Console.WriteLine(numCount); } }