program cookie
  implicit none
  integer :: A, B, C, a1, b1, c1, count, ma, mb, mc
  
  read(*,*) A, B, C
  ma = A
  mb = B
  mc = C
  
  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
     else if ((a1 == ma .and. b1 == mb) .or. (a1 == ma .and. b1 == mc) .or. &
          &   (a1 == mb .and. b1 == ma) .or. (a1 == mb .and. b1 == mc) .or. &
          &   (a1 == mc .and. b1 == ma) .or. (a1 == mc .and. b1 == mb)) then
        write(*,*) -1
        stop
     end if
        
     count = count + 1
     A = a1
     B = b1
     C = c1
  end do

  write(*,*) count
  
  stop
end program cookie
