#!/bin/python import sys def longestSequence(a): # Return the length of the longest possible sequence of moves. count=0 x=len(a) for i in range(x): while(a[i]%2==0): count=count+a[i] a[i]=a[i]/2 if a[i]%2!=0 and a[i]!=1: count=count+a[i]+1 else: count=count+1 return count if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result