fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(' ').map(String::toInt).toIntArray()
    val cntmax = (Math.log(a.min()!!.toDouble()) / Math.log(2.0)).toInt()
    var cnt = 0
    cntr@ for (i in 1..cntmax) {
        for (j in 0 until n) {
            if (a[j] and 1 == 1) break@cntr
            a[j] = a[j] shr 1
        }
        cnt++
    }
    println(cnt)
}
