implicit none

integer :: n
logical :: flg_a, flg_b, flg_c
integer :: tmp_a, tmp_b, tmp_c
integer :: a,b,c

read *,a,b,c

flg_a = isOdd(a)
flg_b = isOdd(b)
flg_c = isOdd(c)
if (flg_a .or. flg_b .or. flg_c) then
   print '(i0)',0
endif

if (a == b .and. b == c .and. c == a) then
   print '(i0)',-1
endif

flg_a = .false.
flg_b = .false.
flg_c = .false.

n = 0
do while (.true.)
   flg_a = isOdd(a)
   flg_b = isOdd(b)
   flg_c = isOdd(c)
   if (flg_a .or. flg_b .or. flg_c) then
      exit
   endif
   n = n + 1
   tmp_a = a
   tmp_b = b
   tmp_c = c
   a = (tmp_b+tmp_c)/2
   b = (tmp_c+tmp_a)/2
   c = (tmp_a+tmp_b)/2
enddo

write(6,'(i0)') n
stop

contains

   logical function isOdd(n)
      integer,intent(in) :: n
      isOdd = mod(n,2) == 1
   end function isOdd

end