import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {
    
    static boolean isPrime(long n){
        
        if(n == 2)
            return true;
        
        if(n % 2 == 0)
            return false;
        
        for(long i = 3; i <= (long)Math.sqrt(n); i+=2){
            if(n % i == 0)
                return false;
        }
        
        return true;
    }

    static long longestSequence(long[] a) {
        //  Return the length of the longest possible sequence of moves.
        
        long res = 0L;
        for(int i = 0; i < a.length; i++){
            long v = a[i];
            ArrayList<Long> primes = new ArrayList<Long>();
            
            if(v == 1){
                res += 1L;
                continue;
            }
            
            if(isPrime(v))
                primes.add(v);
            else{
                long index = 3;
                while(v % 2 == 0){
                    primes.add(2L);
                    v /= 2;
                }
                
                while(v != 1 && !isPrime(v)){
                    while(v % index == 0){
                        primes.add(index);
                        v /= index;
                    }
                    
                    index += 2;
                    while(!isPrime(index))
                        index += 2;
                }
                
                if(v != 1)
                    primes.add(v);
            }
            
            res += 1L;
            long prod = 1L;
            for(int x = primes.size() - 1; x >= 0; x--){
                prod *= primes.get(x);
                res += prod;
            }
        }
        
        return res;
    }

    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();
    }
}