import Data.Bifunctor
 
operatable = all even
operate = map (`div` 2)
count :: [Int] -> Int
count nums = snd $ until (not . operatable . fst) (bimap operate (+ 1)) (nums, 0)
 
main :: IO ()
main = do
    getLine
    strList <- getLine
    print . count $ read <$> words strList