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 i=0; int j=0; long sum=0,n1=0; long n=a.length; while(n!=0) { n1=a[j]; for(i=1;(n1/i)!=1;i++) { if(n1%i==0) { sum=sum+(n1/i); n1=n1/i; i=1; } } // sum=sum+i; n--; j++; } return sum+a.length; } 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(); } }