#!/bin/python3 import sys def solution(n): if n == 1: return 1 r = 1 while not n % 2: r += n n = n // 2 return r + n def longestSequence(a): # Return the length of the longest possible sequence of moves. return sum(solution(i) for i in a) if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)