object Main extends App {
  import scala.io.StdIn.readLine
  
  def exchange(x:Int,y:Int,z:Int):Int={
  if((x % 2 == 0) && (y % 2 == 0) && (z % 2 == 0)){1+exchange((x+y)/2,(y+z)/2,(z+x)/2)}
    else return 0
  }

  	val cookies =readLine.split(" ").map(_.toInt);
  val a = cookies(0)
  val b = cookies(1)
  val c = cookies(2)
  if(a == b && b == c){if(a % 2 == 0){println("-1")}else println("0")}
  else {
  println(exchange(a,b,c))
  }
}
