import java.util.*;

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

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

        int s = sc.nextInt();
        Map<Integer,Integer> list = new HashMap<Integer,Integer>();
        int n = 1;
        while(true){
            list.put(s, s);
            n++;
            if(s % 2 == 0){
                s /= 2;
            }else{
                s = s * 3 + 1;
            }
            if(list.containsKey(s)){
                System.out.println(n);
                break;
            }
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        Map<Integer,Integer> list = new HashMap<Integer,Integer>();
        int n = 1;
        while(true){
            list.put(s, s);
            n++;
            if(s % 2 == 0){
                s /= 2;
            }else{
                s = s * 3 + 1;
            }
            if(list.containsKey(s)){
                System.out.println(n);
                break;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        Map<Integer,Integer> list = new HashMap<Integer,Integer>();
        int n = 1;
        while(true){
            list.put(s, s);
            n++;
            if(s % 2 == 0){
                s /= 2;
            }else{
                s = s * 3 + 1;
            }
            if(list.containsKey(s)){
                System.out.println(n);
                break;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Map<Integer,Integer> list = new HashMap<Integer,Integer>(); list new HashMap<Integer,Integer>() int n = 1; n 1 while(true){
            list.put(s, s);
            n++;
            if(s % 2 == 0){
                s /= 2;
            }else{
                s = s * 3 + 1;
            }
            if(list.containsKey(s)){
                System.out.println(n);
                break;
            }
        } true {
            list.put(s, s);
            n++;
            if(s % 2 == 0){
                s /= 2;
            }else{
                s = s * 3 + 1;
            }
            if(list.containsKey(s)){
                System.out.println(n);
                break;
            }
        } list.put(s, s) list.put list s s n++ n 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.containsKey(s)){
                System.out.println(n);
                break;
            } list.containsKey(s) list.containsKey list s {
                System.out.println(n);
                break;
            } System.out.println(n) System.out.println System.out System System.out n break; String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

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

        int s = sc.nextInt();
        Map<Integer,Integer> list = new HashMap<Integer,Integer>();
        int n = 1;
        while(true){
            list.put(s, s);
            n++;
            if(s % 2 == 0){
                s /= 2;
            }else{
                s = s * 3 + 1;
            }
            if(list.containsKey(s)){
                System.out.println(n);
                break;
            }
        }
    }
} Main
import java.util.*;

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

        int s = sc.nextInt();
        Map<Integer,Integer> list = new HashMap<Integer,Integer>();
        int n = 1;
        while(true){
            list.put(s, s);
            n++;
            if(s % 2 == 0){
                s /= 2;
            }else{
                s = s * 3 + 1;
            }
            if(list.containsKey(s)){
                System.out.println(n);
                break;
            }
        }
    }
}
