import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int i; static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long n,b,s,k=0; fo : for(long t:a){ s=0; b=1; n=0; if(t==1){ k+=1; continue fo; } while(b<=t){ if(t%b==0){ n=t/(t/b); s+=(t/b); i=1; } b=0; i++; b+=n*i; } k+=s; } return k; } 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(); } }