import java.util.Scanner;

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

        int s = sc.nextInt();
        int[] a = new int[1000010];
        a[0] = s;
        boolean isLoop = false;
        for (int i = 1; i < a.length; i++) {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        int[] a = new int[1000010];
        a[0] = s;
        boolean isLoop = false;
        for (int i = 1; i < a.length; i++) {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        int[] a = new int[1000010];
        a[0] = s;
        boolean isLoop = false;
        for (int i = 1; i < a.length; i++) {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        int[] a = new int[1000010];
        a[0] = s;
        boolean isLoop = false;
        for (int i = 1; i < a.length; i++) {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int[] a = new int[1000010]; a new int[1000010] 1000010 a[0] = s a[0] a 0 s boolean isLoop = false; isLoop false for (int i = 1; i < a.length; i++) {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        } int i = 1; int i = 1; i 1 i < a.length i a.length a a.length i++ i++ i {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        } {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        } if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            } a[i-1] % 2 == 0 a[i-1] % 2 a[i-1] a i-1 i 1 2 0 {
                a[i] = a[i-1] / 2;
            } a[i] = a[i-1] / 2 a[i] a i a[i-1] / 2 a[i-1] a i-1 i 1 2 {
                a[i] = 3 * a[i-1] + 1;
            } a[i] = 3 * a[i-1] + 1 a[i] a i 3 * a[i-1] + 1 3 * a[i-1] 3 a[i-1] a i-1 i 1 1 for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            } int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            } {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            } if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                } a[j] == a[i] a[j] a j a[i] a i {
                    isLoop = true;
                    System.out.println(i+1);
                } isLoop = true isLoop true System.out.println(i+1) System.out.println System.out System System.out i+1 i 1 if (isLoop)
                break; isLoop break; String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        int[] a = new int[1000010];
        a[0] = s;
        boolean isLoop = false;
        for (int i = 1; i < a.length; i++) {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        int[] a = new int[1000010];
        a[0] = s;
        boolean isLoop = false;
        for (int i = 1; i < a.length; i++) {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        }
    }
} Main
import java.util.Scanner;

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

        int s = sc.nextInt();
        int[] a = new int[1000010];
        a[0] = s;
        boolean isLoop = false;
        for (int i = 1; i < a.length; i++) {
            if (a[i-1] % 2 == 0) {
                a[i] = a[i-1] / 2;
            } else {
                a[i] = 3 * a[i-1] + 1;
            }
            
            for (int j = 0; j < i; j++) {
                if (a[j] == a[i]) {
                    isLoop = true;
                    System.out.println(i+1);
                }
            }
            
            if (isLoop)
                break;
        }
    }
}
