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 count = 0; for (long stick : a) { count = count + longestSequence(stick); } return count; } private static long longestSequence(long stick) { long count = 0; if (stick == 1) { count = 1; } else if (isPrime(stick)) { count = 1 + stick; } // Check after else { count = 1 + largestPrimeFactor(stick) * longestSequence(stick / largestPrimeFactor(stick)); } return count; } private static long largestPrimeFactor(long stick) { int i; long copyOfInput = stick; for (i = 2; i <= copyOfInput; i++) { if (copyOfInput % i == 0) { copyOfInput /= i; i--; } } return i; } static boolean isPrime(long n) { // check if n is a multiple of 2 if (n == 1 || n == 2) { return true; } if (n % 2 == 0) { return false; } // if not, then just check the odds for (int i = 3; i <= Math.sqrt(n); i += 2) { if (n % i == 0) { return false; } } return true; } 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(); } }