import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a,int n) { // Return the length of the longest possible sequence of moves. int i; long []b= new long [n]; long s1=0,j,limit,flag=1,s2=0,s=0; for(i=0;i=1;j--) { // System.out.println(a[i]); if(a[i]%j==0 ) {s1=s1+ (a[i]/j)*flag; // System.out.println("a[i]/j "+a[i]/j+" a[i] "+a[i]+ " j "+j); flag=(flag)*a[i]/j; a[i]=j;t=j; // j=(j/2); flag2++; //j=2; // System.out.println(s1+" "+flag+"j "+j+" "+a[i]); } } if(flag2==0) { s1=s1+a[i]; } else s1=s1+1; // System.out.println("i "+i); } return (int)s1; } 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,n); System.out.println(result); in.close(); } }