import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static Map memo = new Hashtable<>(); static long longestSequence(long[] a) { memo.put(1L,1L); long totalMoves = 0; for(int i = 0; i < a.length; i++){ totalMoves += moves(a[i], 1, a[i], 0); } return totalMoves; } public static long moves(long n, long size, long piece, long m){ //System.out.println("size: " + String.valueOf(size)); //System.out.println("piece: " + String.valueOf(piece)); //System.out.println("m: " + String.valueOf(m)); if(size == n && piece == 1){ //System.out.println("here"); return (m + 1); } long s = size; int i = 2; while(size * i <= n){ double newSize = size * i; if((((n*1.0)/newSize) % 1.0 == 0.0) && ((newSize/(size*1.0)) % 1.0 == 0.0) ){ s = (long)newSize; return moves(n, s, n/s, m + piece); } i++; } return piece + 1; //if(size == 1 && piece == n){ // return memo.get(n); //} //else{ // if(newSizeFound){ // return memo.get(s) * (n/s); // }else{ // return memo.get(size) * piece; //} //} } 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(); } }