program cookie
  implicit none
  integer :: A, B, C, a1, b1, c1, count
  
  read(*,*) A, B, C

  if (A == B .and. B == C) then
     write(*,*) -1
     stop
  end if
  
  count = 1
  do while (.true.)
     c1 = (A + B) / 2
     a1 = (B + C) / 2
     b1 = (C + A) / 2
     if (mod(c1,2) == 1 .or. mod(a1,2) == 1 .or. mod(b1,2) == 1) then
        exit
     end if
     count = count + 1
     A = a1
     B = b1
     C = c1
  end do

  write(*,*) count
  
  stop
end program cookie
