import java.io.*;
import java.util.*;

class Program{

}
class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int count = 1,N = in.nextInt();
        Set<Integer> S = new HashSet<Integer>();
        S.add(N);
        while(true){
            if(N%2==0){
                N/=2;
            }
            else{
                N = 3*N+1;
            }
            S.add(N);
            count++;
            if(S.size()<count) {
                System.out.println(count);
                break;
            }
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java class Program{

} Program class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int count = 1,N = in.nextInt();
        Set<Integer> S = new HashSet<Integer>();
        S.add(N);
        while(true){
            if(N%2==0){
                N/=2;
            }
            else{
                N = 3*N+1;
            }
            S.add(N);
            count++;
            if(S.size()<count) {
                System.out.println(count);
                break;
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int count = 1,N = in.nextInt();
        Set<Integer> S = new HashSet<Integer>();
        S.add(N);
        while(true){
            if(N%2==0){
                N/=2;
            }
            else{
                N = 3*N+1;
            }
            S.add(N);
            count++;
            if(S.size()<count) {
                System.out.println(count);
                break;
            }
        }
    } main {
        Scanner in = new Scanner(System.in);
        int count = 1,N = in.nextInt();
        Set<Integer> S = new HashSet<Integer>();
        S.add(N);
        while(true){
            if(N%2==0){
                N/=2;
            }
            else{
                N = 3*N+1;
            }
            S.add(N);
            count++;
            if(S.size()<count) {
                System.out.println(count);
                break;
            }
        }
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int count = 1 count 1 N = in.nextInt(); N in.nextInt() in.nextInt in Set<Integer> S = new HashSet<Integer>(); S new HashSet<Integer>() S.add(N) S.add S N while(true){
            if(N%2==0){
                N/=2;
            }
            else{
                N = 3*N+1;
            }
            S.add(N);
            count++;
            if(S.size()<count) {
                System.out.println(count);
                break;
            }
        } true {
            if(N%2==0){
                N/=2;
            }
            else{
                N = 3*N+1;
            }
            S.add(N);
            count++;
            if(S.size()<count) {
                System.out.println(count);
                break;
            }
        } if(N%2==0){
                N/=2;
            }
            else{
                N = 3*N+1;
            } N%2==0 N%2 N 2 0 {
                N/=2;
            } N/=2 N 2 {
                N = 3*N+1;
            } N = 3*N+1 N 3*N+1 3*N 3 N 1 S.add(N) S.add S N count++ count if(S.size()<count) {
                System.out.println(count);
                break;
            } S.size()<count S.size() S.size S count {
                System.out.println(count);
                break;
            } System.out.println(count) System.out.println System.out System System.out count break; String[] args args
import java.io.*;
import java.util.*;

class Program{

}
class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int count = 1,N = in.nextInt();
        Set<Integer> S = new HashSet<Integer>();
        S.add(N);
        while(true){
            if(N%2==0){
                N/=2;
            }
            else{
                N = 3*N+1;
            }
            S.add(N);
            count++;
            if(S.size()<count) {
                System.out.println(count);
                break;
            }
        }
    }
}