import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { long count = 0; 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(); if( (a[a_i] % 2) == 0 ) { long p = a[a_i]; while( (p % 2) == 0 ) { count+= ( p / 2 ); p =( p / 2 ); } count = (count + a[a_i] + 1); } else if( a[a_i] == 1) { count+= 1; } else { count+= (a[a_i] + 1); } } System.out.println( count ); } }