program main
  implicit none
  integer :: n, i, mi
  integer, allocatable :: a(:)
  read(*, *) n
  allocate(a(n))
  read(*, *) (a(i), i = 1, n)
  mi = 999999
  do i = 1, n
    mi = min(mi, fact_of_two(a(i)))
  end do
  write(*, "(i0)"), mi
  deallocate(a)

  contains

  function fact_of_two(i)
    implicit none
    integer :: i, j, fact_of_two
    do j = 0, 100
      if (mod(i, 2 ** j) /= 0) then
        exit
      end if
    end do
    if (j < 1) stop 1
    fact_of_two = j - 1
  end function fact_of_two
end
