import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        ArrayList<Integer> data = new ArrayList<Integer>();
        data.add(s);
        boolean judge = false;
        
        int i=1;
        while(judge == false){
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        ArrayList<Integer> data = new ArrayList<Integer>();
        data.add(s);
        boolean judge = false;
        
        int i=1;
        while(judge == false){
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        ArrayList<Integer> data = new ArrayList<Integer>();
        data.add(s);
        boolean judge = false;
        
        int i=1;
        while(judge == false){
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        ArrayList<Integer> data = new ArrayList<Integer>();
        data.add(s);
        boolean judge = false;
        
        int i=1;
        while(judge == false){
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc ArrayList<Integer> data = new ArrayList<Integer>(); data new ArrayList<Integer>() data.add(s) data.add data s boolean judge = false; judge false int i=1; i 1 while(judge == false){
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        } judge == false judge false {
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        } if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            } data.get(i-1)%2 == 0 data.get(i-1)%2 data.get(i-1) data.get data i-1 i 1 2 0 {
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            } int tmp1 = data.get(i-1)/2; tmp1 data.get(i-1)/2 data.get(i-1) data.get data i-1 i 1 2 if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                } data.contains(tmp1) data.contains data tmp1 {
                    System.out.println(i+1);
                    judge = true;
                } System.out.println(i+1) System.out.println System.out System System.out i+1 i 1 judge = true judge true data.add(tmp1) data.add data tmp1 {
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            } int tmp2 = 3*data.get(i-1)+1; tmp2 3*data.get(i-1)+1 3*data.get(i-1) 3 data.get(i-1) data.get data i-1 i 1 1 if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                } data.contains(tmp2) data.contains data tmp2 {
                    System.out.println(i+1);
                    judge = true;
                } System.out.println(i+1) System.out.println System.out System System.out i+1 i 1 judge = true judge true data.add(tmp2) data.add data tmp2 i++ i String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        ArrayList<Integer> data = new ArrayList<Integer>();
        data.add(s);
        boolean judge = false;
        
        int i=1;
        while(judge == false){
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        ArrayList<Integer> data = new ArrayList<Integer>();
        data.add(s);
        boolean judge = false;
        
        int i=1;
        while(judge == false){
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        ArrayList<Integer> data = new ArrayList<Integer>();
        data.add(s);
        boolean judge = false;
        
        int i=1;
        while(judge == false){
            if(data.get(i-1)%2 == 0){
                int tmp1 = data.get(i-1)/2;
                if(data.contains(tmp1)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp1);
            }else{
                int tmp2 = 3*data.get(i-1)+1;
                if(data.contains(tmp2)){
                    System.out.println(i+1);
                    judge = true;
                }
                data.add(tmp2);
            }
            
            i++;
            
        }
    }
}
