import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static ArrayList primeFactors(long n){ ArrayList result = new ArrayList(); for(int i = 2; i <= n/2+2; i+=2){ while (n % i == 0) { n = n / i; result.add(i); } if (i > n){ break; } if(i == 2){ i--; } } return result; } static long longestSequence(long[] a) { long result = 0; for(int i = 0; i < a.length; i++){ long pieces = 1; ArrayList primeFactors = primeFactors(a[i]); for(int j = primeFactors.size() - 1; j >= 0; j--){ a[i] /= primeFactors.get(j); result += pieces; pieces *= primeFactors.get(j); } if(a[i] > 1){ result += pieces; pieces *= a[i]; } result += pieces; } return result; } 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(); } }