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 result = 0L; for (int i = 0; i < a.length; i++) { result += sequence(a[i]); } return result; } static long sequence(long a) { if (a == 1L) return 1L; long delim = 1L; for (long d = 2L, curA = a; d <= Math.sqrt(curA); d++) { if (curA % d == 0) { delim *= d; curA /= d; d = 1L; } } if (delim == 1L) return 1 + a; return 1 + a / delim * sequence(delim); } 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(); } }