fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    println(test(readLine()!!.split(" ").map(String::toInt),
            false, 0))
}

fun test(A : List<Int>, flag : Boolean, count : Int) : Int {
    var tmp : MutableList<Int> = mutableListOf()
    if (flag) {
        return count
    }
    for (Ai in 0..A.size.minus(1)) {
        if (A[Ai] % 2 != 0) {
            return test(tmp, true, count)
        } else {
            tmp.add(Ai, A[Ai] / 2)
        }
    }
    return test(tmp, false, count.plus(1))
}