program cookie
  implicit none
  integer(8) :: A, B, C, a1, b1, c1, count
  
  read(*,*) A, B, C
  if (A == B .and. B == C) then
     if (mod(A,2) == 0) then
        write(*,*) -1
     else
        write(*,*) 0
     end if
     stop
  end if
  a1 = A
  b1 = B
  c1 = C
  count = 0
  do while (.true.)
     if (mod(c1,2) == 1 .or. mod(a1,2) == 1 .or. mod(b1,2) == 1) then
        exit
     end if
     A = a1
     B = b1
     C = c1
     c1 = (A + B) / 2
     a1 = (B + C) / 2
     b1 = (C + A) / 2
     count = count + 1
  end do

  write(*,*) count
  
  stop
end program cookie