import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt(); 
        
        Set<Integer> set = new HashSet<>();
        set.add(s);
        
        int ans = 1;
        int before = s;
        set.add(before);
        while(true){
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        }
        
        System.out.println(ans);
    }
    
    static int f(int n){
        if( n % 2 == 0 ) return n/2;
        return 3 * n + 1;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt(); 
        
        Set<Integer> set = new HashSet<>();
        set.add(s);
        
        int ans = 1;
        int before = s;
        set.add(before);
        while(true){
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        }
        
        System.out.println(ans);
    }
    
    static int f(int n){
        if( n % 2 == 0 ) return n/2;
        return 3 * n + 1;
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt(); 
        
        Set<Integer> set = new HashSet<>();
        set.add(s);
        
        int ans = 1;
        int before = s;
        set.add(before);
        while(true){
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        }
        
        System.out.println(ans);
    } main {
        
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt(); 
        
        Set<Integer> set = new HashSet<>();
        set.add(s);
        
        int ans = 1;
        int before = s;
        set.add(before);
        while(true){
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        }
        
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Set<Integer> set = new HashSet<>(); set new HashSet<>() set.add(s) set.add set s int ans = 1; ans 1 int before = s; before s set.add(before) set.add set before while(true){
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        } true {
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        } int x = f(before); x f(before) f before ans++ ans before = x before x if( set.contains(before) ){
                break;
            } set.contains(before) set.contains set before {
                break;
            } break; set.add(before) set.add set before System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int f(int n){
        if( n % 2 == 0 ) return n/2;
        return 3 * n + 1;
    } f {
        if( n % 2 == 0 ) return n/2;
        return 3 * n + 1;
    } if( n % 2 == 0 ) return n/2; n % 2 == 0 n % 2 n 2 0 return n/2; n/2 n 2 return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt(); 
        
        Set<Integer> set = new HashSet<>();
        set.add(s);
        
        int ans = 1;
        int before = s;
        set.add(before);
        while(true){
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        }
        
        System.out.println(ans);
    }
    
    static int f(int n){
        if( n % 2 == 0 ) return n/2;
        return 3 * n + 1;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt(); 
        
        Set<Integer> set = new HashSet<>();
        set.add(s);
        
        int ans = 1;
        int before = s;
        set.add(before);
        while(true){
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        }
        
        System.out.println(ans);
    }
    
    static int f(int n){
        if( n % 2 == 0 ) return n/2;
        return 3 * n + 1;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt(); 
        
        Set<Integer> set = new HashSet<>();
        set.add(s);
        
        int ans = 1;
        int before = s;
        set.add(before);
        while(true){
            int x = f(before);
            ans++;
            before = x;
            if( set.contains(before) ){
                break;
            }
            set.add(before);
        }
        
        System.out.println(ans);
    }
    
    static int f(int n){
        if( n % 2 == 0 ) return n/2;
        return 3 * n + 1;
    }
}
