using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long calc(long n) { long sqrt = (long)(Math.Ceiling(Math.Sqrt(n))); long w = 0; long a = n; for (long i = 2; i <= sqrt; ++i) { long r = a % i; while (r == 0) { w += a; a = a / i; r = a % i; } if(a == 1) { break; } } if(a > 1) { w += a; } w++; return w; } static long longestSequence(long[] a) { long result = 0; foreach (long n in a) { long pr = calc(n); result += pr; } return (result); } 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); } }