import Data.Bits

right_bit :: Int -> Int
right_bit x = let c = x .&. 1 in
  case c of
    1 -> 0
    0 -> 1 + (right_bit (shiftR x 1))

main :: IO ()
main = do
  n <- readLn :: IO Int
  x:rs <- fmap (\x -> read x :: Int) <$> words <$> getLine
  print $ right_bit $ foldl (.|.) x rs
