using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long longestSequence(long[] a, int n) { // Return the length of the longest possible sequence of moves. long sum = 0; for(int i =0; i< n; i++){ long stick = a[i]; if(stick > 1){ sum++; } sum = sum + stick; while(stick%2 == 0){ stick = (stick / 2); sum = sum + stick; } } return sum; } static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] a_temp = Console.ReadLine().Split(' '); long[] a = Array.ConvertAll(a_temp,Int64.Parse); long result = longestSequence(a, n); Console.WriteLine(result); } }