import java.util.Scanner; public class question3 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int n=s.nextInt(); int step=0; while(n!=0){ int a=s.nextInt(); step+=a; int divide=1; while(a!=1){ if(a%2!=0){ a--; }else{ step+=divide; int val=(a/2)%2; if(val!=0&&a/2!=1) {divide*=a/2; a=2; } else{ divide*=2; a=a/2; } } } divide=1; n--; } System.out.println(step); } }