main :: IO()
main = do
  _ <- getLine
  ai <- map read . words <$> getLine
  print $ slv (product ai) 32 0

slv :: Integer -> Integer -> Integer -> Integer
slv n 0 ret = ret
slv n m ret | n `mod` 2^m == 0 = slv (n `div` 2^m) m (ret + m)
            | otherwise = slv n (m-1) ret