import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author DELL */ public class BreakingSticks { static long dp(long n) { if(n==1) {return 1;} for(long i=2;i<=Math.sqrt(n);i++){ if(n%i==0){ //System.out.println(n+dp(n/i)); return (n+dp(n/i)); } } return n+1; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); //long[] a = new long[n]; long sum=0l; for(int a_i = 0; a_i < n; a_i++){ long a = in.nextLong(); sum += dp(a); } System.out.println(sum); in.close(); } }