#!/bin/python import sys def longestSequence(a): # Return the length of the longest possible sequence of moves. g=[] for i in range(len(a)): if(a[i]%2!=0 and a[i]!=1): moves = a[i] + 1 elif(a[i]==1): moves = 1 elif(a[i]%2==0): count = 0 for k in range(100): m = float(a[i])/2 if(m==int(m)): count = count + 1 a[i] = a[i]/2 else: break l = a[i] * pow(2,count) * (2 * ( 1 - pow(0.5,count+1))) moves = l + 1 g.append(moves) return (int)(sum(g)) if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result