program answer
  implicit none

  integer :: A,B,C,i,a0,b0,c0

  read(*,*) A,B,C
  a0=A
  b0=B
  c0=c
  i =0
  if (A==B.and.A==C.and. mod(A,2)==0) then
     i = -1
  else
     do while(mod(A,2)==0 .and. mod(B,2)==0 .and. mod(C,2)==0) 
     a0=b0/2+c0/2
     b0=A/2+c0/2
     c0=A/2+B/2
     a = a0
     b = b0
     c = c0
     
     i = i + 1
     end do
  end if
  write(*,*) i

  stop
 end program answer
