import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long l = 2; static long longestSequence(long[] a) { long sum = 0; for(int i=0; i< a.length; i++){ long s = 1; int nnn = (int) (Math.log(a[i]) / Math.log(2)); long[] ab = new long[nnn+1]; l=2; long mult = 1; long as = a[i]; int count = 0; primeFactors(as,ab); int champ = 0; int chimp = 0; while(ab[champ]!=0){ chimp = champ+1; while(ab[chimp]!=0){ ab[champ] = ab[champ]*ab[chimp]; chimp++; } s = s + ab[champ]; champ++; } sum = sum + s; } return sum; } public static void generate(){ if(l==2) l=3; else{ long count=0; for(int j=0;;j++){ l=l+2; long x= (long)Math.sqrt(l); for(long i=2;i<=x+1;i++){ count=0; if(l%i==0){ count++; break;} } if(count==0) break; } } } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long[] a = new long[n]; for(int a_i = 0; a_i < n; a_i++){ a[a_i] = in.nextLong(); } long result = longestSequence(a); System.out.println(result); in.close(); } public static void primeFactors(long n,long[] ab) { int i = 0; // Print the number of 2s that divide n while (n%2==0) { n /= 2; ab[i] = 2; i++; } // n must be odd at this point. So we can // skip one element (Note i = i +2) for (l = 3; l <= (long)Math.sqrt(n); l+= 2) { // While i divides n, print i and divide n while (n%l == 0) { n /= l; ab[i] = l; i++; } } // This condition is to handle the case whien // n is a prime number greater than 2 if (n > 2) { l=n; ab[i] = l; i++; } } }