import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static long[] decPrim(long n) { List list = new ArrayList<>(); for( int i=2; i<=n ; i++){ while(n!=i ) { if(n%i!=0) { break; } list.add(Long.valueOf(i)); n = n/i; } } list.add(n); long[] toReturn = list.stream().mapToLong(Long::longValue).toArray(); Arrays.sort(toReturn); return toReturn; } static long longestSequence(long[] a) { long toReturn = 0l; for (int i = 0; i < a.length; i++) { long result = 1l; long l = a[i]; long[] temp = decPrim(l); for (int j = 0; j < temp.length; j++) { long m = temp[j]; if(m==1) { result = 1; } else { result = 1 + m * result; } } toReturn += result; } return toReturn; } 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(); } }