import java.util.*; class max { long maxdiv(long n) { long replace,sum=0,i,temp; replace=n; temp=replace; while(replace>1) { for(i=replace/2;i>0;i--) { if(replace%i==0) { sum+=i; break; } } replace=i; } return sum+temp; } } class BreakingSticks { public static void main(String args[]) { Scanner ob=new Scanner(System.in); max ob1=new max(); int n,i,j; long sum=0; n=ob.nextInt(); long a[]=new long[n]; for(i=0;i