import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a) { Map rMem = new HashMap<>(); long result = 0; for (int i = 0; i < a.length; i++) { result += longestSequence(a[i], rMem); } return result; } static long longestSequence(long n, Map rMem) { if (n == 1) { return 1; } if (rMem.containsKey(n)) { return rMem.get(n); } long k = getMaxPrimeDiv(n); if (k == 1) { return 1 + n; } long div = n / k; long result = 1 + (k * longestSequence(div, rMem)); rMem.put(n, result); return result; } private static long getMaxPrimeDiv(long n) { long result = 1; long cur = n; for (long d = 2; cur > 1; d++) { if ((cur % d) == 0) { result = d; do { cur /= d; } while (cur > 1 && (cur % d) == 0); } } 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(); } }