import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a) { long moves = 0; for(long choc : a){ ArrayList factors = getPrimeFactors(choc); long prod = 1; for(int i = factors.size() - 1; i >= 0; i--){ prod *= factors.get(i); moves += prod; } moves++; } return moves; } private static ArrayList getPrimeFactors(long a){ final int TWO = 2; ArrayList factors = new ArrayList<>(); while(a % TWO == 0){ factors.add(new Long(TWO)); a = a / TWO; } for(long i = TWO + 1; i <= Math.sqrt(a); i+= TWO){ while(a % i == 0) { factors.add(i); a = a / i; } } if(a > 1) factors.add(a); return factors; } 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(); } }