import qualified Control.Arrow         as Arrow
import qualified Data.ByteString.Char8 as BSC8
import qualified Data.Vector.Unboxed   as VU

type Parser a = BSC8.ByteString -> Maybe (a, BSC8.ByteString)

parseInt :: Parser Int
parseInt = fmap (Arrow.second BSC8.tail) . BSC8.readInt
parseAN :: Int -> IO (VU.Vector Int)
parseAN n = VU.unfoldrN n parseInt <$> BSC8.getLine

main :: IO ()
main = do
  n  <- readLn :: IO Int
  xv <- parseAN n
  print $ solver xv

solver :: VU.Vector Int -> Int
solver xv
  | VU.all even xv = 1 + solver (VU.map (flip div 2) xv)
  | otherwise      = 0
