import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int longestSequence(int[] a) { int retVal = 0; for(int t = 0; t < a.length;t++) { int n = a[t]; int[] arr = new int[n + 1]; arr[0] = 0; arr[1] = 1; if(n == 1) { retVal += arr[1]; continue; } arr[2] = 3; if(n == 2) { retVal += arr[2]; continue; } arr[3] = 4; for(int i = 4;i <= n;i++) { int max = 0; for(int j = 1;j <= i / 2;j++) { if(i % j == 0) max = Math.max(max, arr[j] * (i / j)); } arr[i] = max + 1; } retVal += arr[n]; } return retVal; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a = new int[n]; for(int a_i = 0; a_i < n; a_i++){ a[a_i] = in.nextInt(); } long result = longestSequence(a); System.out.println(result); in.close(); } }