import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. ArrayList arr=new ArrayList<>(); boolean flag[]=new boolean[1000001]; for(int i=2;i<=1000000;i++) { if(!flag[i]) { for(int j=2*i;j<=1000000;j+=i) flag[j]=true; arr.add(i); } } long ans=0; for(int i=0;i1&&ktemp) {fl=true;break;} if(temp%arr.get(k)==0) { ans+=temp/arr.get(k); temp/=arr.get(k); } else ++k; } ans++; } return ans; } 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(); } }