program sample
    implicit none
    
    integer(8) :: a,b,c,i,j,m,n,k,a1,b1,c1,x,y
    

    read(*,*) a,b,c
    if (a==b .and. b==c)then
        write(*,*)-1
        stop
    end if

    if (mod(a,2)==1 .or. mod(b,2)==1 .or. mod(c,2)==1) then
        write(*,*)0
        stop
    end if

    x=abs(a-b)
    y=abs(b-c)
    m=0
    do while(mod(x,2)==0 .and. mod(y,2)==0)
        x=x/2
        y=y/2
        m=m+1
    end do
    
    write(*,*)m
    
    stop
end program sample
  

