let change a = 
	let rec change a n = 
    	if a land 1 = 0 then change (a lsr 1) (n + 1) else n
    in change a 0
let calc n = 
	let rec calc n ans = 
    	if n = 0 then ans else calc (n - 1) (ans + Scanf.scanf " %d" change)
    in calc n 0
let main = print_int (Scanf.scanf "%d" calc)