program main
	implicit none
    integer(8)::a,b,c,d,e,f
    integer(8)::g,h,i
    read(*,*) a,b,c
    if(a>b)then
    	d=a-b
    else
    	d=b-a
    end if
    if(c>b)then
    	e=c-b
    else
    	e=b-c
    end if
    if(a>c)then
    	f=a-c
    else
    	f=c-a
    end if
    
    if (d==0 .and. e==0 .and. f==0)then
    	if(mod(a,2)==0)then
    		write(*,*) -1
        else
        	write(*,*) 0
        end if
    
    else
    	if (d==0)then
        	g=1000000000
        else
        	g=0
    		do while(mod(d,2)==0)
    			d=d/2
            	g=g+1
        	end do
        end if
        if (e==0)then
        	h=1000000000
        else
        	h=0
    		do while(mod(e,2)==0)
    			e=e/2
            	h=h+1
        	end do
        end if
        if (f==0)then
        	i=1000000000
        else
        	i=0
    		do while(mod(f,2)==0)
    			f=f/2
            	i=i+1
        	end do
        end if
        
        write(*,*) min(g,min(h,i))
    end if
    stop
end program main

        
        
