using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long findBestPrime(long num) { if (num == 2) return 2; if (num % 2 == 0) return findBestPrime(num/2); int limit = (int)Math.Sqrt(num); for (int i =3; i <= limit; i+= 2){ if (num % i == 0) return Math.Max(i, findBestPrime(num/i)); } return num; } static long calcSingle(long bar) { if (bar == 1) return 1; long bestPrime = findBestPrime(bar); return 1 + bestPrime*calcSingle(bar/bestPrime); } static long longestSequence(long[] a) { long ans = 0; for (int i = 0; i < a.Length; i++) { ans += calcSingle(a[i]); } return ans; } 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); } }