import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)

    val N = sc.nextInt()
    val arr = Array.fill(N)(sc.nextInt())

    var num = 0
    var loop: Boolean = true

    while (loop) {
      var flg = 0

      for (i <- 0 until N) {
        if (arr(i) % 2 == 0 && arr(i) != 2) arr(i) /= 2
        else {
          arr(i) *= 3
          flg += 1
        }
      }
      if (N == flg) loop = false
      else num += 1
    }

    println(num)

  }
}
