import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(int n,long[] a) { long result = 0; long x = 0; for (int i = 0; i < n; i++){ long[] numDivisors = new long[50]; int counter = 0; x = a[i]; long divisor = 0; while (x > 3){ divisor = x; for (long j = x/2; j > 1; j--){ if (x % j == 0){ boolean isPrime = true; if (j!=2){ for (long k = 2; k < j; k++){ if(j%k == 0){ isPrime = false; break; } } } if (isPrime){ divisor = j; break; } } } x = x/divisor; numDivisors[counter] = divisor; counter++; } if (x == 3 || x == 2){ numDivisors[counter] = x; counter++; } long temp = 1; for (int j = counter - 1; j >=0; j--) temp = temp*numDivisors[j] + 1; result += temp; } return result; } 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(n, a); System.out.println(result); in.close(); } }