import Data.Char
main = do
  getLine
  foldr (\x y -> min y $ sol x)  10000 . map read . words  <$> getLine >>= print

sol :: Int -> Int
sol 0 = 0
sol x
  | x `mod` 2 == 0 = 1 + sol (x `div` 2)
  | otherwise = 0


