using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long longestSequence(long[] a) { long result = 0; for (long i=0; i< a.Length; ++i) { result += Count(a[i]); } return result; } static long Count(long stickLength) { long initialLength = stickLength; if (stickLength == 1) { //return 1; } long result = 0; long count = 1; long firstMult = FindFirstMultiplier(stickLength); bool t = false; while (firstMult != 1) { t = true; long prevCount = count; count = stickLength / firstMult; stickLength = firstMult; if (result == 0) { result = 1; } else { result *= prevCount; } firstMult = FindFirstMultiplier(stickLength); } if (t) { result += count; } else { result++; } result+= initialLength; return result; } 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); } public static long FindFirstMultiplier(long r) { for (long i = 2; i <= r / 2; ++i) { if (r%i == 0) return i; } return 1; } }