import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;

public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        List<Integer> memory = new ArrayList<>();
        memory.add(num);

        while(true){
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        }

    }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        List<Integer> memory = new ArrayList<>();
        memory.add(num);

        while(true){
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        }

    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        List<Integer> memory = new ArrayList<>();
        memory.add(num);

        while(true){
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        }

    } main {
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        List<Integer> memory = new ArrayList<>();
        memory.add(num);

        while(true){
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        }

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan List<Integer> memory = new ArrayList<>(); memory new ArrayList<>() memory.add(num) memory.add memory num while(true){
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        } true {
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        } if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            } num % 2 == 0 num % 2 num 2 0 {
                num /= 2;
            } num /= 2 num 2 {
                num = num * 3 + 1;
            } num = num * 3 + 1 num num * 3 + 1 num * 3 num 3 1 if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            } memory.contains(num) memory.contains memory num {
                System.out.println(memory.size() + 1);
                break;
            } System.out.println(memory.size() + 1) System.out.println System.out System System.out memory.size() + 1 memory.size() memory.size memory 1 break; {
                memory.add(num);
            } memory.add(num) memory.add memory num String[] args args public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        List<Integer> memory = new ArrayList<>();
        memory.add(num);

        while(true){
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        }

    }
} public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        List<Integer> memory = new ArrayList<>();
        memory.add(num);

        while(true){
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        }

    }
} Main
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;

public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        List<Integer> memory = new ArrayList<>();
        memory.add(num);

        while(true){
            if(num % 2 == 0){
                num /= 2;
            } else {
                num = num * 3 + 1;
            }
            if(memory.contains(num)){
                System.out.println(memory.size() + 1);
                break;
            } else {
                memory.add(num);
            }
        }

    }
}