import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        Integer x = sc.nextInt();
        Set<Integer> st = new HashSet<Integer>();
        int count = 1;
         
        while(!st.contains(x)){
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        }     
        System.out.println(count);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        Integer x = sc.nextInt();
        Set<Integer> st = new HashSet<Integer>();
        int count = 1;
         
        while(!st.contains(x)){
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        }     
        System.out.println(count);
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        Integer x = sc.nextInt();
        Set<Integer> st = new HashSet<Integer>();
        int count = 1;
         
        while(!st.contains(x)){
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        }     
        System.out.println(count);
    } main {
        
        Scanner sc = new Scanner(System.in);
        Integer x = sc.nextInt();
        Set<Integer> st = new HashSet<Integer>();
        int count = 1;
         
        while(!st.contains(x)){
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        }     
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Integer x = sc.nextInt(); x sc.nextInt() sc.nextInt sc Set<Integer> st = new HashSet<Integer>(); st new HashSet<Integer>() int count = 1; count 1 while(!st.contains(x)){
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        } !st.contains(x) st.contains(x) st.contains st x {
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        } st.add(x) st.add st x if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            } x % 2 == 0 x % 2 x 2 0 {
                x = x/2;
            } x = x/2 x x/2 x 2 if(x % 2 == 1){
                x = 3 * x + 1;
            } x % 2 == 1 x % 2 x 2 1 {
                x = 3 * x + 1;
            } x = 3 * x + 1 x 3 * x + 1 3 * x 3 x 1 count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        Integer x = sc.nextInt();
        Set<Integer> st = new HashSet<Integer>();
        int count = 1;
         
        while(!st.contains(x)){
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        }     
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        Integer x = sc.nextInt();
        Set<Integer> st = new HashSet<Integer>();
        int count = 1;
         
        while(!st.contains(x)){
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        }     
        System.out.println(count);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        Integer x = sc.nextInt();
        Set<Integer> st = new HashSet<Integer>();
        int count = 1;
         
        while(!st.contains(x)){
            st.add(x);
            if(x % 2 == 0){
                x = x/2;
            }else if(x % 2 == 1){
                x = 3 * x + 1;
            }
            count++;
        }     
        System.out.println(count);
    }
}