import Control.Monad
import Data.List
main=do
    _<-getLine
    print=<<minimum.map (div2 0).map read.words<$>getLine
div2 :: Int->Int->Int
div2 n a
    | even a = div2 (n+1) (a`div`2)
    | True = n