import Control.Applicative ((<$>))
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.List (unfoldr)
import Data.Char (isSpace)

main :: IO ()
main = solve <$> (B.getLine >> (readil B.readInt <$> B.getLine)) >>= print

solve :: [Int] -> Int
solve = sum . map (f 0)
  where f c x | even x = f (c+1) (x `div` 2)
              | otherwise = c

readil :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> [a]
readil f = unfoldr g
  where
    g s = do
      (n, s') <- f s
      return (n, B.dropWhile isSpace s')
