import qualified Data.ByteString.Char8 as C
import Data.Maybe ( fromJust )

readInts :: IO [Int]
readInts = map (fst . fromJust . C.readInt) . C.words <$> C.getLine

main :: IO ()
main = do
  _  <- getLine 
  as <- readInts
  print $ minimum $ map f as 

f :: Int -> Int
f = g 0
 
g acc n
  | even n = g (acc+1) (n `div` 2)
  | odd  n = acc
