using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long longestSequence(long[] numbers) { long total=0; foreach(var number in numbers){ long sum=number; long factor=number; for (int b = 2; factor > 1; b++){ if (factor % b == 0) { long x = 0; while (factor % b == 0) { factor /= b; sum+=factor; x++; } } } total+=sum; } return total; } 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); } }