import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long movesPerChocolate(long chSize){ long moves = 1; long d = 0; long chPieces = 1; long originalChSize = chSize; while(chSize != 1){ d = chSize - 1; while(chSize % d != 0 && chSize > 1){ d--; } if(d == 1){ d = chSize; } chSize = chSize / d; chPieces = originalChSize / chSize; moves += chPieces; System.err. println("D: " + d + "; Size: " + chSize + "; Pieces: " + chPieces + "; Moves: " + moves); } System.err.println("Total Moves: " + moves); return moves; } static long longestSequence(long[] a) { long totalMoves = 0; for(long i : a){ totalMoves += movesPerChocolate(i); } return totalMoves; } 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(); } }