import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        a.add(s);
        int n = f(s);
        for(int i = 1; !a.contains(n); i++){
            a.add(n);
            n = f(n);
        }
        System.out.println(a.size() + 1);
        scan.close();
    }
    
    public static int f(int n){
        if(n % 2 == 0) return n / 2;
        return n * 3 + 1;
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        a.add(s);
        int n = f(s);
        for(int i = 1; !a.contains(n); i++){
            a.add(n);
            n = f(n);
        }
        System.out.println(a.size() + 1);
        scan.close();
    }
    
    public static int f(int n){
        if(n % 2 == 0) return n / 2;
        return n * 3 + 1;
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        a.add(s);
        int n = f(s);
        for(int i = 1; !a.contains(n); i++){
            a.add(n);
            n = f(n);
        }
        System.out.println(a.size() + 1);
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        a.add(s);
        int n = f(s);
        for(int i = 1; !a.contains(n); i++){
            a.add(n);
            n = f(n);
        }
        System.out.println(a.size() + 1);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int s = scan.nextInt(); s scan.nextInt() scan.nextInt scan ArrayList<Integer> a = new ArrayList<>(); a new ArrayList<>() a.add(s) a.add a s int n = f(s); n f(s) f s for(int i = 1; !a.contains(n); i++){
            a.add(n);
            n = f(n);
        } int i = 1; int i = 1; i 1 !a.contains(n) a.contains(n) a.contains a n i++ i++ i {
            a.add(n);
            n = f(n);
        } {
            a.add(n);
            n = f(n);
        } a.add(n) a.add a n n = f(n) n f(n) f n System.out.println(a.size() + 1) System.out.println System.out System System.out a.size() + 1 a.size() a.size a 1 scan.close() scan.close scan String[] args args public static int f(int n){
        if(n % 2 == 0) return n / 2;
        return n * 3 + 1;
    } f {
        if(n % 2 == 0) return n / 2;
        return n * 3 + 1;
    } if(n % 2 == 0) return n / 2; n % 2 == 0 n % 2 n 2 0 return n / 2; n / 2 n 2 return n * 3 + 1; n * 3 + 1 n * 3 n 3 1 int n n public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        a.add(s);
        int n = f(s);
        for(int i = 1; !a.contains(n); i++){
            a.add(n);
            n = f(n);
        }
        System.out.println(a.size() + 1);
        scan.close();
    }
    
    public static int f(int n){
        if(n % 2 == 0) return n / 2;
        return n * 3 + 1;
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        a.add(s);
        int n = f(s);
        for(int i = 1; !a.contains(n); i++){
            a.add(n);
            n = f(n);
        }
        System.out.println(a.size() + 1);
        scan.close();
    }
    
    public static int f(int n){
        if(n % 2 == 0) return n / 2;
        return n * 3 + 1;
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        a.add(s);
        int n = f(s);
        for(int i = 1; !a.contains(n); i++){
            a.add(n);
            n = f(n);
        }
        System.out.println(a.size() + 1);
        scan.close();
    }
    
    public static int f(int n){
        if(n % 2 == 0) return n / 2;
        return n * 3 + 1;
    }
}