import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static void findPrimeFactors(long stick, PriorityQueue factors) { for (long i = 2; i <= stick; i++) { while (stick % i == 0) { stick /= i; factors.add(i); } } if (factors.isEmpty()) factors.add(stick); } static long hMoves(long stick, PriorityQueue factors) { if (stick == 1) return 1; long maxPrime = factors.poll(); stick /= maxPrime; long result = 1 + maxPrime * hMoves(stick, factors); return result; } static long maxMoves(long stick) { PriorityQueue factors = new PriorityQueue(10, new Comparator() { @Override public int compare(Long a, Long b) { if ((b - a) > 0) return 1; else if ((b - a) == 0) return 0; else return -1; } }); long result = 0; findPrimeFactors(stick, factors); return hMoves(stick, factors); } static long longestSequence(long[] a) { long max = 0; for (int i = 0; i < a.length; i++) { max += maxMoves(a[i]); } return max; } 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(); } }