import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        // 初項を変数に格納する
        int s = console.nextInt();

        List<Integer> numbers = new ArrayList<>();

        // リストに初項を追加
        int lastNum = s;
        int currentNum = s;
        int answer = 0;
        numbers.add(currentNum);

        // 数列をリストに追加していく
        for(int i = 2; i <= 10000; i++){
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        }

        System.out.println(answer);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        // 初項を変数に格納する
        int s = console.nextInt();

        List<Integer> numbers = new ArrayList<>();

        // リストに初項を追加
        int lastNum = s;
        int currentNum = s;
        int answer = 0;
        numbers.add(currentNum);

        // 数列をリストに追加していく
        for(int i = 2; i <= 10000; i++){
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        }

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

        // 初項を変数に格納する
        int s = console.nextInt();

        List<Integer> numbers = new ArrayList<>();

        // リストに初項を追加
        int lastNum = s;
        int currentNum = s;
        int answer = 0;
        numbers.add(currentNum);

        // 数列をリストに追加していく
        for(int i = 2; i <= 10000; i++){
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        }

        System.out.println(answer);
    } main {
        Scanner console = new Scanner(System.in);

        // 初項を変数に格納する
        int s = console.nextInt();

        List<Integer> numbers = new ArrayList<>();

        // リストに初項を追加
        int lastNum = s;
        int currentNum = s;
        int answer = 0;
        numbers.add(currentNum);

        // 数列をリストに追加していく
        for(int i = 2; i <= 10000; i++){
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        }

        System.out.println(answer);
    } Scanner console = new Scanner(System.in); console new Scanner(System.in) int s = console.nextInt(); s console.nextInt() console.nextInt console List<Integer> numbers = new ArrayList<>(); numbers new ArrayList<>() int lastNum = s; lastNum s int currentNum = s; currentNum s int answer = 0; answer 0 numbers.add(currentNum) numbers.add numbers currentNum for(int i = 2; i <= 10000; i++){
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        } int i = 2; int i = 2; i 2 i <= 10000 i 10000 i++ i++ i {
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        } {
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        } if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            } lastNum % 2 == 0 lastNum % 2 lastNum 2 0 {
                currentNum = lastNum / 2;
            } currentNum = lastNum / 2 currentNum lastNum / 2 lastNum 2 {
                currentNum = 3 * lastNum + 1;
            } currentNum = 3 * lastNum + 1 currentNum 3 * lastNum + 1 3 * lastNum 3 lastNum 1 if(numbers.contains(currentNum)){
                answer = i;
                break;
            } numbers.contains(currentNum) numbers.contains numbers currentNum {
                answer = i;
                break;
            } answer = i answer i break; numbers.add(currentNum) numbers.add numbers currentNum lastNum = currentNum lastNum currentNum System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        // 初項を変数に格納する
        int s = console.nextInt();

        List<Integer> numbers = new ArrayList<>();

        // リストに初項を追加
        int lastNum = s;
        int currentNum = s;
        int answer = 0;
        numbers.add(currentNum);

        // 数列をリストに追加していく
        for(int i = 2; i <= 10000; i++){
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        }

        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        // 初項を変数に格納する
        int s = console.nextInt();

        List<Integer> numbers = new ArrayList<>();

        // リストに初項を追加
        int lastNum = s;
        int currentNum = s;
        int answer = 0;
        numbers.add(currentNum);

        // 数列をリストに追加していく
        for(int i = 2; i <= 10000; i++){
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        }

        System.out.println(answer);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        // 初項を変数に格納する
        int s = console.nextInt();

        List<Integer> numbers = new ArrayList<>();

        // リストに初項を追加
        int lastNum = s;
        int currentNum = s;
        int answer = 0;
        numbers.add(currentNum);

        // 数列をリストに追加していく
        for(int i = 2; i <= 10000; i++){
            if(lastNum % 2 == 0 ){
                currentNum = lastNum / 2;
            }else {
                currentNum = 3 * lastNum + 1;
            }

            if(numbers.contains(currentNum)){
                answer = i;
                break;
            }
            numbers.add(currentNum);
            lastNum = currentNum;
        }

        System.out.println(answer);
    }
}
