program sample
    implicit none
    character(100)::s,t
    integer(8) :: i,j,k,m,n
    integer(8)::a,b,c,d
    integer(8),allocatable::x(:),y(:)
  
    read(*,*) n
    allocate(x(n))
    read(*,*)x
    do i=1,n
        a=0
        b=x(i)
        do j=1,100
            if(mod(b,2)/=0)then
                x(i)=a
            else
                a=a+1
                b=b/2
            end if
        end do
    end do
    write(*,*)minval(x)

    stop
end program sample
  

