#!/bin/python import sys def longestSequence(a): # Return the length of the longest possible sequence of moves. #..sticks of odd length are best broken up into segments of length 1 then eaten if a == 1: return 1 elif a % 2 == 1: return a + 1 m = 1 n = 0 done = False while done == False: v = a / (2 ** n) if v == ( a * 1.0 / (2 ** n)): m = m + v n = n + 1 else: #print "DONE! %i" % m done = True return m if __name__ == "__main__": n = int(raw_input().strip()) aa = map(long, raw_input().strip().split(' ')) print sum([ longestSequence(a) for a in aa]) #result = longestSequence(a) #print result