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