using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long factorize(long x, long j, Dictionary factors) { if(x == 1) return 1; if(factors.ContainsKey(x)) return factors[x]; while(j * j <= x && x % j != 0) j++; if(j * j > x) factors.Add(x, x + 1); else factors.Add(x, x + factorize(x / j, j, factors)); return factors[x]; } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long seq = 0; Dictionary factors = new Dictionary(); for(int i = 0; i < a.Length; i++) { seq+= factorize(a[i], 2, factors); } return seq; } 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); } }