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 longest = 0; foreach (var stickLen in a) { longest += Divisors(stickLen); } return longest; } public static long Divisors(long x) { if (x == 1) return 1; var cCount = x; for (long i = 2; i <= Math.Sqrt(x); i++) { if (x % i == 0) { x /= i; cCount += x; i--; } } return cCount + 1; } 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); } }