import Control.Applicative

main :: IO ()
main = do
    n <- readLn :: IO Int
    a <- map read . words <$> getLine

    putStrLn $ show (solve a 0)

solve :: [Int] -> Int -> Int
solve a i
    | sum modLst == 0 = solve divLst (i + 1)
    | otherwise       = i
    where dmLst  = [(d, m) | x <- a, let (d, m) = divMod x 2]
          divLst = [d | (d, m) <- dmLst]
          modLst = [m | (d, m) <- dmLst]
