import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static ArrayList primes; public static int MAX = 1000000; public static void main(String[] args) { generatePrimes(); Scanner in = new Scanner(System.in); int n = in.nextInt(); long result = 0; for(int i = 0; i < n; i++){ long a = in.nextLong(); result += calculateMoves(a); } System.out.println(result); in.close(); } public static void generatePrimes() { primes = new ArrayList<>(); for (long i = 2; i <= MAX; i++) { boolean isPrime = true; for (int j = 0; j < primes.size() && primes.get(j) <= Math.sqrt(i); j++) { if (i % primes.get(j) == 0) { isPrime = false; break; } } if (isPrime) { primes.add(i); } } } private static long calculateMoves(long a) { long count = 1; int i = 0; while(a > 1 && i < primes.size()){ if(a%primes.get(i)==0){ count = (count*primes.get(i))+1; a = a/primes.get(i); }else{ i++; } } if(a > 1){ count = (count*a)+1; } return count; } }