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. long div=1; if(a==1)return 1; for(long i=((long)Math.sqrt(a)+(a/2))/2;i<=a/2;i++) if(a%i==0) { div=i;break; } if(div!=1) return (a/div)+(a/div)*longestSequence(div); else return a; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a = new long[n]; for(int a_i = 0; a_i < n; a_i++){ a[a_i] = sc.nextLong(); } long sum=0; for(int i=0;i