#!/bin/python3 import sys def factor(n,k): if n==1: return([]) while (not n%k==0) and k**2n: return([n]) elif n%k==0: return([k]+factor(n//k,k)) def test(l): if len(l)==0: return(1) if len(l)==1 and l[0]==1: return(1) elif len(l)==1: return(l[0]+1) else: p = max(l) l.remove(p) return(1+p*test(l)) def longestSequence(a): # Return the length of the longest possible sequence of moves. num = sum([test(factor(i,2)) for i in a]) return(num) if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)