cRewrite :: (Int, [Int]) -> (Int, [Int])
cRewrite (c, is)
    | all (==0) is || any odd is = (c, [])
    | otherwise                  = cRewrite (c + 1, map (`div`2) is)

main = getLine >> getLine >>= \cs -> print . fst $ cRewrite (0, map (read :: String -> Int) (words cs))