import java.util.*;

public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int s=sc.nextInt(); //初項
        int f[]=new int[1000001];
        System.out.println(cal(s,f,0));
        
    }
    public static int cal(int s,int[]f,int count){
        f[s]++;
        count++;
        if(f[s]>=2) return count;
        if(s%2==0) s/=2;
        else s=s*3+1;
        return cal(s,f,count);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int s=sc.nextInt(); //初項
        int f[]=new int[1000001];
        System.out.println(cal(s,f,0));
        
    }
    public static int cal(int s,int[]f,int count){
        f[s]++;
        count++;
        if(f[s]>=2) return count;
        if(s%2==0) s/=2;
        else s=s*3+1;
        return cal(s,f,count);
    }
} Main public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int s=sc.nextInt(); //初項
        int f[]=new int[1000001];
        System.out.println(cal(s,f,0));
        
    } main {
        Scanner sc=new Scanner(System.in);
        int s=sc.nextInt(); //初項
        int f[]=new int[1000001];
        System.out.println(cal(s,f,0));
        
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int s=sc.nextInt(); s sc.nextInt() sc.nextInt sc int f[]=new int[1000001]; f new int[1000001] 1000001 System.out.println(cal(s,f,0)) System.out.println System.out System System.out cal(s,f,0) cal s f 0 String[]args args public static int cal(int s,int[]f,int count){
        f[s]++;
        count++;
        if(f[s]>=2) return count;
        if(s%2==0) s/=2;
        else s=s*3+1;
        return cal(s,f,count);
    } cal {
        f[s]++;
        count++;
        if(f[s]>=2) return count;
        if(s%2==0) s/=2;
        else s=s*3+1;
        return cal(s,f,count);
    } f[s]++ f[s] f s count++ count if(f[s]>=2) return count; f[s]>=2 f[s] f s 2 return count; count if(s%2==0) s/=2;
        else s=s*3+1; s%2==0 s%2 s 2 0 s/=2 s 2 s=s*3+1 s s*3+1 s*3 s 3 1 return cal(s,f,count); cal(s,f,count) cal s f count int s s int[]f f int count count public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int s=sc.nextInt(); //初項
        int f[]=new int[1000001];
        System.out.println(cal(s,f,0));
        
    }
    public static int cal(int s,int[]f,int count){
        f[s]++;
        count++;
        if(f[s]>=2) return count;
        if(s%2==0) s/=2;
        else s=s*3+1;
        return cal(s,f,count);
    }
} public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int s=sc.nextInt(); //初項
        int f[]=new int[1000001];
        System.out.println(cal(s,f,0));
        
    }
    public static int cal(int s,int[]f,int count){
        f[s]++;
        count++;
        if(f[s]>=2) return count;
        if(s%2==0) s/=2;
        else s=s*3+1;
        return cal(s,f,count);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int s=sc.nextInt(); //初項
        int f[]=new int[1000001];
        System.out.println(cal(s,f,0));
        
    }
    public static int cal(int s,int[]f,int count){
        f[s]++;
        count++;
        if(f[s]>=2) return count;
        if(s%2==0) s/=2;
        else s=s*3+1;
        return cal(s,f,count);
    }
}