using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long totalMoves = 0; for (int i = 0; i < a.Length; i++) { long barSize = a[i]; while (barSize > 1) { totalMoves += barSize; long divisor = 0; for (int j = 2; j <= Math.Sqrt(barSize); j++) { if (barSize % j == 0) { divisor = j; break; } } if (divisor == 0) { divisor = barSize; } barSize /= divisor; } totalMoves += 1; } return totalMoves; } 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); } }