using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long longestSequence(long[] x) { long seq = 0; for(int i=0; i< x.Length; i++) { seq = seq + getMoves(x[i]); } return seq; } static long getMoves(long n) { var moves = n > 1 ? n + ((n%2 == 0) && (n / 2) > 1 ? getMoves(n / 2) : 1) : 1; return moves; } 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); Console.WriteLine(result); } }