import java.util.Scanner; public class BreakingSticks { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt() ; long array[] = new long[n] ; for(int i = 0 ; i < n ; i++) { array[i] = sc.nextLong(); } long sum = 0 ; for(int i = 0 ; i < n ; i++) { long temp = array[i] ; sum += temp ; long j = 2 ; while (temp != 1) { if(temp%j == 0) { temp = temp/j ; sum += temp ; } else { j++ ; } } // sum += 1 ; } System.out.println(sum); } }