#import <stdio.h>
typedef long long INT;
int main(){
    INT a,b,c;
    scanf("%lld %lld %lld",&a,&b,&c);
    INT A=2*a-b-c;
    INT B=2*b-c-a;
    INT C=2*c-a-b;
    if(A==0&&B==0&&C==0) {
        puts("-1");
        return 0;
    }else{
        INT i=0;
        while(A%2==0&&B%2==0&&C%2==0){
            A/=-2;
            B/=-2;
            C/=-2;
            INT x=a+b+c+A;
            INT y=a+b+c+B;
            INT z=a+b+c+C;
            if(!(x%3==0&&y%3==0&&z%3==0)){
                break;
            }
            i++;
        }
        printf("%lld",i);
    }
}
