using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { long[] mmoves = new long[100]; static long longestSequence(long[] a) { // a contains values for multiple chocolate bars // Return the length of the longest possible sequence of moves. long longest = 0; int len = a.Length; for(int i = 0; i < len; i++) { long ai = a[i]; long mm = maxMoves(ai); // + a[i]; longest += mm; } return longest; } // static long LargestPrime(long n) // { // long nsquared = Convert.ToInt64(Math.Sqrt(Convert.ToDouble(n))); // for(long i = nsquared; i > 1; i--) { // if(n % i == 0) { // return i; // } // } // // return n; // } static private long LargestPrime (long n) { long k = 2; while (k * k <= n) { if (n % k == 0) { n /= k; } else { ++k; } } return n; } static long maxMoves(long n) { if(n == 1) { return 1; } long lp = LargestPrime(n); long ni = n / lp; return 1 + lp * maxMoves(ni); } static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] a_temp = Console.ReadLine().Split(' '); long[] a = Array.ConvertAll(a_temp,Int64.Parse); long result = longestSequence(a); Console.WriteLine(result); Console.ReadLine(); } }