{-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Text.Printf
import Debug.Trace

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

main = do
  [n] <- getInts
  xs <- map f <$> getInts
  print $ minimum xs


-- util
getInts :: IO [Int]
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

