   program agc014
      implicit none
      integer(8)::a,b,c
      integer(8)::aa,bb,cc
      integer(8)::count
      
         read *, a,b,c
         
         if (a==b .and. b==c .and. c==a) then
            if (mod(a,2)==0) then
               print *, '-1'
            else
               print *, '0'
            end if
            stop
         end if
            
         aa=a;bb=b;cc=c
         count=0
         do while (mod(a,2)==0 .and. mod(b,2)==0 .and. mod(c,2)==0)
            a=a+bb/2+cc/2
            b=b+cc/2+aa/2
            c=c+aa/2+bb/2
            count=count+1
            aa=a;bb=b;cc=c
         end do
         
         print *, count

   end program agc014
