import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc =new Scanner(System.in);
        int[] a = new int[1000000];
        a[0] = sc.nextInt();        
        int ans = 0;
  
        //計算処理          
        for(int i = 1; i <1000000; i++){
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       }
       
       System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc =new Scanner(System.in);
        int[] a = new int[1000000];
        a[0] = sc.nextInt();        
        int ans = 0;
  
        //計算処理          
        for(int i = 1; i <1000000; i++){
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       }
       
       System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc =new Scanner(System.in);
        int[] a = new int[1000000];
        a[0] = sc.nextInt();        
        int ans = 0;
  
        //計算処理          
        for(int i = 1; i <1000000; i++){
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       }
       
       System.out.println(ans);
    } main {
        
        Scanner sc =new Scanner(System.in);
        int[] a = new int[1000000];
        a[0] = sc.nextInt();        
        int ans = 0;
  
        //計算処理          
        for(int i = 1; i <1000000; i++){
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       }
       
       System.out.println(ans);
    } Scanner sc =new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[1000000]; a new int[1000000] 1000000 a[0] = sc.nextInt() a[0] a 0 sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for(int i = 1; i <1000000; i++){
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       } int i = 1; int i = 1; i 1 i <1000000 i 1000000 i++ i++ i {
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       } {
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       } if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           } a[i-1] % 2 == 0 a[i-1] % 2 a[i-1] a i-1 i 1 2 0 {
               a[i] = a[i-1]/2;
           } a[i] = a[i-1]/2 a[i] a i a[i-1]/2 a[i-1] a i-1 i 1 2 if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           } a[i-1] % 2 == 1 a[i-1] % 2 a[i-1] a i-1 i 1 2 1 {
               a[i] = 3*a[i-1] + 1;
           } a[i] = 3*a[i-1] + 1 a[i] a i 3*a[i-1] + 1 3*a[i-1] 3 a[i-1] a i-1 i 1 1 for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            } int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
               if(a[j] == a[i]){
                   ans = i+1;
               }
            } {
               if(a[j] == a[i]){
                   ans = i+1;
               }
            } if(a[j] == a[i]){
                   ans = i+1;
               } a[j] == a[i] a[j] a j a[i] a i {
                   ans = i+1;
               } ans = i+1 ans i+1 i 1 if(ans != 0)break; ans != 0 ans 0 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc =new Scanner(System.in);
        int[] a = new int[1000000];
        a[0] = sc.nextInt();        
        int ans = 0;
  
        //計算処理          
        for(int i = 1; i <1000000; i++){
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       }
       
       System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc =new Scanner(System.in);
        int[] a = new int[1000000];
        a[0] = sc.nextInt();        
        int ans = 0;
  
        //計算処理          
        for(int i = 1; i <1000000; i++){
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       }
       
       System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc =new Scanner(System.in);
        int[] a = new int[1000000];
        a[0] = sc.nextInt();        
        int ans = 0;
  
        //計算処理          
        for(int i = 1; i <1000000; i++){
           if(a[i-1] % 2 == 0){
               a[i] = a[i-1]/2;
           }else if(a[i-1] % 2 == 1){
               a[i] = 3*a[i-1] + 1;
           }

            //評価
           for(int j = 0; j < i; j++){
               if(a[j] == a[i]){
                   ans = i+1;
               }
            }
            if(ans != 0)break;
       }
       
       System.out.println(ans);
    }
}
