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 pieces = 1; long count = a.length; long num = 1; int q = 0; long temp = 0; for (int i=0; i Math.ceil(Math.sqrt(a[i]/num))){ //If past sqrt point and no divisors left, then check a[i] temp = temp+1; temp *= (a[i]/num); break; } if (num == a[i]){ break; } //Checks if prime, then just change temp to prime /*if (j == Math.ceil(Math.sqrt(a[i])) && temp == 0){ temp += a[i]; break; }*/ } count += temp; } return count; } 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(); } }