#!/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                if(i==3):                    i=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)