implicit none

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

read *,a,b,c

flg_a = (mod(a,2) == 1)
flg_b = (mod(b,2) == 1)
flg_c = (mod(c,2) == 1)
if (flg_a .or. flg_b .or. flg_c) then
   print '(i0)',0
   stop
endif

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

n = 0
do while (.true.)
   if (mod(a,2) == 1) exit
   if (mod(b,2) == 1) exit
   if (mod(c,2) == 1) exit
   n = n + 1
   tmp_a = a
   tmp_b = b
   a = (tmp_b+c)/2
   b = (c+tmp_a)/2
   c = (tmp_a+tmp_b)/2
enddo

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