import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long metod(long a){ int rez =0; long sum =a; long b =a; while(b!=1){ sum += b/2; b = b/2; } return sum; } static long longestSequence(long[] a) { long sum = 0; long sumUkupno =0; int r = 0; for(int i = 0;i1){ sum = (int) (a[i]+1); sumUkupno +=sum; }else if(a[i]%2==0){ sum = metod(a[i]); sumUkupno +=sum; }else{ sum =1; sumUkupno +=sum; } } return sumUkupno; } 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(); } long result = longestSequence(a); System.out.println(result); in.close(); } }