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