import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long Sequence(long a) { if(a==1){ return 1; } else if(a==0){ return 0; } // Return the length of the longest possible sequence of moves. long start=1,mul=1; ArrayListfactors=new ArrayList(); for(int i=2;i<=a;++i){ while(a%i==0){ factors.add(i); a/=i; } } for(int i=factors.size()-1;i>=0;--i){ mul*=factors.get(i); start+=mul; } return start; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long[] a = new long[n]; long seq=0; for(int a_i = 0; a_i < n; a_i++){ a[a_i] = in.nextLong(); seq+=Sequence(a[a_i]); } System.out.println(seq); in.close(); } }