import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static List decompose(long n) { List primes = new ArrayList<>(); double N = Math.sqrt(n); while (n % 2 == 0) { n /= 2; primes.add(2L); } for (long i = 3; i <= N; i += 2) { while (n % i == 0) { n /= i; primes.add(i); } } if (n > 1) primes.add(n); return primes; } static long longestSequence(long[] a) { int n = a.length; long sum = 0; for (int i = 0; i < n; ++i) { long b = a[i]; List factors = decompose(b); Collections.sort(factors); for (int j = 0; j < factors.size(); ++j) { sum += b; b /= factors.get(j); } ++sum; } return sum; } 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(); } }