void main()
{
    long[] abc = readln.split.to!(long[]);
    if (abc.all!"a % 2 == 0")
    {
        if (abc.all!(x => x == abc[0]))
        {
            writeln(-1);
        }
        else
        {
            long cnt;
            while (abc.all!"a % 2 == 0")
            {
                long[] tmp = new long[3];
                foreach (i; 0 .. 3)
                {
                    tmp[i] = (abc[(i+1)%3] + abc[(i+2)%3]) / 2;
                }
                abc = tmp;
                ++cnt;
            }
            cnt.writeln;
        }
    }
    else
    {
        0.writeln;
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;