import java.util.*;

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

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

    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int i = 1;
        list.add(s);
        while(true){
            i ++;
            if(s % 2 == 0){
                s /= 2;
            }else {
                s = s * 3 + 1;
            }
            if(list.contains(s)){
                System.out.println(i);
                break;
            }
            list.add(s);
        }

    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int i = 1;
        list.add(s);
        while(true){
            i ++;
            if(s % 2 == 0){
                s /= 2;
            }else {
                s = s * 3 + 1;
            }
            if(list.contains(s)){
                System.out.println(i);
                break;
            }
            list.add(s);
        }

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

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

    }
} Main
import java.util.*;

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

    }
}