import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long solve(long a) { if (a == 1L) return 1L; long biggestPowerOf2 = 1; long count = 0; long res = 1; while (true) { long next = biggestPowerOf2 * 2L; if (next > a || a % next != 0L) { break; } biggestPowerOf2 = next; ++count; } long div = a / biggestPowerOf2; for (long i = 0; i <= count; i++) { res += div * (long) Math.pow(2, i); } return res; } static long longestSequence(long[] a) { long res = 0L; for (int i = 0; i < a.length; i++) { res += solve(a[i]); } return res; } 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(); } }