import java.util.ArrayList;

import java.util.Scanner;

public class Main {



    public static void main(String[] args){

    	Scanner sc = new Scanner(System.in);



    	// 入力

    	int s = sc.nextInt();

    	ArrayList<Integer> arg = new ArrayList<>();
      	arg.add(s);

    	int i;



    	for (i = 0; i < 1000002; i++ ){

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	}



    	// 出力

    	System.out.println(i+2);

    }

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



    public static void main(String[] args){

    	Scanner sc = new Scanner(System.in);



    	// 入力

    	int s = sc.nextInt();

    	ArrayList<Integer> arg = new ArrayList<>();
      	arg.add(s);

    	int i;



    	for (i = 0; i < 1000002; i++ ){

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	}



    	// 出力

    	System.out.println(i+2);

    }

} Main public static void main(String[] args){

    	Scanner sc = new Scanner(System.in);



    	// 入力

    	int s = sc.nextInt();

    	ArrayList<Integer> arg = new ArrayList<>();
      	arg.add(s);

    	int i;



    	for (i = 0; i < 1000002; i++ ){

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	}



    	// 出力

    	System.out.println(i+2);

    } main {

    	Scanner sc = new Scanner(System.in);



    	// 入力

    	int s = sc.nextInt();

    	ArrayList<Integer> arg = new ArrayList<>();
      	arg.add(s);

    	int i;



    	for (i = 0; i < 1000002; i++ ){

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	}



    	// 出力

    	System.out.println(i+2);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc ArrayList<Integer> arg = new ArrayList<>(); arg new ArrayList<>() arg.add(s) arg.add arg s int i; i for (i = 0; i < 1000002; i++ ){

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	} i = 0; i = 0 i 0 i < 1000002 i 1000002 i++ i++ i {

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	} {

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	} if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	} s % 2 == 0 s % 2 s 2 0 {

        		s = s / 2;

        	} s = s / 2 s s / 2 s 2 {

        		s = 3 * s + 1;

        	} s = 3 * s + 1 s 3 * s + 1 3 * s 3 s 1 if (arg.contains(s)){

        		break;



        	} arg.contains(s) arg.contains arg s {

        		break;



        	} break; arg.add(s) arg.add arg s System.out.println(i+2) System.out.println System.out System System.out i+2 i 2 String[] args args public class Main {



    public static void main(String[] args){

    	Scanner sc = new Scanner(System.in);



    	// 入力

    	int s = sc.nextInt();

    	ArrayList<Integer> arg = new ArrayList<>();
      	arg.add(s);

    	int i;



    	for (i = 0; i < 1000002; i++ ){

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	}



    	// 出力

    	System.out.println(i+2);

    }

} public class Main {



    public static void main(String[] args){

    	Scanner sc = new Scanner(System.in);



    	// 入力

    	int s = sc.nextInt();

    	ArrayList<Integer> arg = new ArrayList<>();
      	arg.add(s);

    	int i;



    	for (i = 0; i < 1000002; i++ ){

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	}



    	// 出力

    	System.out.println(i+2);

    }

} Main
import java.util.ArrayList;

import java.util.Scanner;

public class Main {



    public static void main(String[] args){

    	Scanner sc = new Scanner(System.in);



    	// 入力

    	int s = sc.nextInt();

    	ArrayList<Integer> arg = new ArrayList<>();
      	arg.add(s);

    	int i;



    	for (i = 0; i < 1000002; i++ ){

        	if(s % 2 == 0){

        		s = s / 2;

        	} else {

        		s = 3 * s + 1;

        	}



        	if (arg.contains(s)){

        		break;



        	}

        	arg.add(s);



    	}



    	// 出力

    	System.out.println(i+2);

    }

}