module Main where

import Control.Applicative
import Control.Monad
import Data.List

f x | odd x     = 0
    | otherwise = 1 + f (x `div` 2)

main :: IO ()
main = do
    getLine
    as <- fmap read . words <$> getLine
    print $ minimum (fmap f as)