import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long sum(long num) { long ret = num; while(num!=1) { int i; while(num%2==0) { ret += num/2; num = num/2; } if(num==1) break; for(i=2;i<=Math.sqrt(num);i++) { if(num%i==0) break; } if(i>Math.sqrt(num)) // num is prime number { ret += 1; num = 1; }else { ret += num/i; num = num/i; } } return ret; } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long ret=0; for(long num:a) { if(num==1) ret+=1; else { ret+=sum(num); } } return ret; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long[] a = new long[n]; long maxn = 0; for(int a_i = 0; a_i < n; a_i++){ a[a_i] = in.nextLong(); if(a[a_i] > maxn) maxn = a[a_i]; } long result = longestSequence(a); System.out.println(result); in.close(); } }