import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long valueOfSequence(long a) { if ( a == 1) { return 1; } if ( a == 2) { return 3; } if ( a == 3) { return 4; } long sq = (long) Math.sqrt(a); long s = 0; long max = a; for (long i = 2; i <= sq; i++) { if (a%i == 0) { long first = i * valueOfSequence(a/i); long second = (a/i)*valueOfSequence(i); s = (first > second)?first:second; if (max < s) { max = s; } } } return (max + 1); } static long longestSequence(long[] a) { long sum = 0; for (int index = 0; index < a.length; index++) { Long nom = new Long(a[index]); long ms = (long)Math.sqrt(nom); long max =nom * valueOfSequence(1L); long s = 0; for (long j = 2; j <= ms; j++) { if ((nom%j) == 0) { long first = j * valueOfSequence(nom/j); long second = (nom/j)*valueOfSequence(j); s = (first > second)?first:second; if (max < s) { max = s; } } } if (nom == 1) { sum +=1; } else { sum += (max + 1); } } return sum; } 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(); } }