import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public long prevsum=1,n,r,count=0,ans=0,curmul; public long prime[]=new long[]{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149,151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223,227,229}; public static void main(String[] args) throws Exception { Solution p=new Solution(); p.input(); } public void input() throws Exception { n= Long.parseLong(br.readLine()); StringTokenizer t=new StringTokenizer(br.readLine()); while(t.hasMoreTokens()) { r= Long.parseLong(t.nextToken()); if(r!=1) { for(int i=49;i>=0;i--) { if(r%prime[i] == 0) { while(r%prime[i] ==0) { if(count==0) { prevsum=prevsum*prime[i]; curmul=prevsum; count++; //System.out.println(prevsum); } else { prevsum=prevsum + curmul*prime[i] ; //System.out.println(prevsum); curmul=curmul*prime[i]; } r=r/prime[i]; //System.out.println("primeno is"+ " "+prime[i]); //System.out.println("r is"+ " "+r); } } } prevsum+=1; ans+=prevsum; prevsum=1; count=0; } else { ans+=1; } } System.out.println(ans); } }