object Main extends App {
  @scala.annotation.tailrec
  def loop(nums: Seq[Int], count: Int): Int = {
    val next = nums.combinations(2).map(_.sum / 2).toSeq.sorted
    if (nums == next) -1 else if (nums.exists(_ % 2 == 1)) count else loop(next, count + 1)
  }
  val sc = new java.util.Scanner(System.in)
  println(loop(Seq.fill(3)(sc.nextInt()).sorted, 0))
}
