Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below:

* Each person simultaneously divides his cookies in half and gives one half to each of the other two persons.



This action will be repeated until there is a person with odd number of cookies in hand.

How many times will they repeat this action? Note that the answer may not be finite.

Constraints

* 1 ≤ A,B,C ≤ 10^9

Input

Input is given from Standard Input in the following format:


A B C


Output

Print the number of times the action will be performed by the three people, if this number is finite. If it is infinite, print `-1` instead.

Examples

Input

4 12 20


Output

3


Input

14 14 14


Output

-1


Input

454 414 444


Output

1
import java.util.*;
import java.io.*;
import java.math.*;


import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;


public class Main{ 


    static long mod=1000000007;
    //  static int dx[]={1,-1,0,0};
    //  static int dy[]={0,0,1,-1};
    // static int dx[]={1,-1,0,0,1,1,-1,-1};
    // static int dy[]={0,0,1,-1,1,-1,1,-1}; 

public  static void main(String[] args)   throws Exception, IOException{

    
    Reader sc = new Reader(System.in);
    PrintWriter out=new PrintWriter(System.out);

//  int n=sc.nextInt();  
  // int n=sc.nextInt(), k=sc.nextInt();  
  // int s=sc.nextInt(), t=sc.nextInt(); 
    // int n = sc.nextInt();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = sc.nextLong();
    long d[] = {a,b,c},ans=100;
    for( int i=0; i<3; i++ ){
        long x=d[i],y=d[(i+1)%3],z=d[(i+2)%3];
        long e[]= {1,0,0}, v=2;
        for( int t=0; t<40; t++, v*=2 ){
            long w=e[0]*x+e[1]*y+e[2]*z;
            long tmp[]= {e[0],e[1],e[2]};

          //  db(x,y,z,w,e,v);
            if(w % v != 0){ans=min(ans, t); break;}
            e[0] = tmp[1]+tmp[2];
            e[1] = tmp[0]+tmp[1];
            e[2] = tmp[0]+tmp[1];
        }
    }
    //ans;
    if(ans==100)ans=-1;

    out.println(ans);
    out.flush();
}

static void db(Object... os){

    System.err.println(Arrays.deepToString(os));

}

static boolean validpos(int x,int y,int r, int c){
    
    return x<r && 0<=x && y<c && 0<=y;
    
}
 
static boolean bit(long x,int k){
    // weather k-th bit (from right) be one or zero
    return  ( 0 < ( (x>>k) & 1 )  )  ? true:false;
}

}

class P implements Comparable<P>{
    int x,y;
    P(int x, int y) {
        this.x=x;
        this.y=y;
    } 
      
    public int compareTo(P p){
        return x - p.x;
    } 
}

class Reader
{ 
    private BufferedReader x;
    private StringTokenizer st;
    
    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}

