import java.io.*; import java.util.*; import java.math.*; public class fact { int move=0; long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. int i, j, k,mv=1; for(k=0; k al = new ArrayList(); long z=1,cz=1; long x=a[k]; for(i=2; i<=a[k]/2; i++) { if(x%2==0 && i%2==0) { if((i & (i-1)) ==0) al.add(i); } } for(i=al.size()-1; i>=0; i--) { if(al.get(i)==2) { mv+=3*(a[k]/2); } else { z=x/al.get(i); cz*=z; x=x/z; mv+=cz; } } move+=mv; } } return move; } 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(); } fact ob=new fact(); long result = ob.longestSequence(a); System.out.println(result); in.close(); } }