object Main extends App {
  var a = readInt
  var ab = readLine.split(" ").map(_.toInt)
  var sum = 9999
  def b(c:Int,d:Int):Int ={
    if(c%2!=1) {
      b(c/2,d+1)
    } else {
     return d
    }
  }
  for(i <- 0 until a) {
    sum = Math.min(sum,b(ab(i),0))
  }
  println(sum)  
}