import Data.List
main = mapM_ (print . solve) . map (map read . words) . lines =<< getContents
solve abc = f a b c 0 where [a,b,c] = sort abc
f a b c n
  |odd a || odd b || odd c = n
  |a==b && b==c = -1
  |otherwise = f ((a+b)`div`2) ((a+c)`div`2) ((b+c)`div`2) (n+1)