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 longestLength = 0; for (int i = 0; i < n; i++) { long chocLen = a[i]; bool checker = true; do { longestLength += chocLen; if (chocLen % 2 == 0 && chocLen > 2) { chocLen = chocLen/2; } else if (chocLen > 1){ chocLen = 1; } else if (chocLen == 1) { checker = false; } } while (checker); } return longestLength; } 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); } struct Choc{ public long size; public Choc(long _size) { size = _size; } } }