import java.util.*;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int s = sc.nextInt();

        int i = 1;
        int a = s;
        HashSet<Integer> nums = new HashSet<>();
        nums.add(a);
        while (true) {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        }
    }
} import java.util.*; util.* java public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int s = sc.nextInt();

        int i = 1;
        int a = s;
        HashSet<Integer> nums = new HashSet<>();
        nums.add(a);
        while (true) {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        }
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        int s = sc.nextInt();

        int i = 1;
        int a = s;
        HashSet<Integer> nums = new HashSet<>();
        nums.add(a);
        while (true) {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        }
    } main {
        int s = sc.nextInt();

        int i = 1;
        int a = s;
        HashSet<Integer> nums = new HashSet<>();
        nums.add(a);
        while (true) {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        }
    } int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int i = 1; i 1 int a = s; a s HashSet<Integer> nums = new HashSet<>(); nums new HashSet<>() nums.add(a) nums.add nums a while (true) {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        } true {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        } i++ i if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            } a % 2 == 0 a % 2 a 2 0 {
                a /= 2;
            } a /= 2 a 2 {
                a = 3 * a + 1;
            } a = 3 * a + 1 a 3 * a + 1 3 * a 3 a 1 if (nums.contains(a)) {
                System.out.println(i);
                return;
            } nums.contains(a) nums.contains nums a {
                System.out.println(i);
                return;
            } System.out.println(i) System.out.println System.out System System.out i return; nums.add(a) nums.add nums a String[] args args public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int s = sc.nextInt();

        int i = 1;
        int a = s;
        HashSet<Integer> nums = new HashSet<>();
        nums.add(a);
        while (true) {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        }
    }
} public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int s = sc.nextInt();

        int i = 1;
        int a = s;
        HashSet<Integer> nums = new HashSet<>();
        nums.add(a);
        while (true) {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        }
    }
} Main
import java.util.*;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int s = sc.nextInt();

        int i = 1;
        int a = s;
        HashSet<Integer> nums = new HashSet<>();
        nums.add(a);
        while (true) {
            i++;
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            if (nums.contains(a)) {
                System.out.println(i);
                return;
            }
            nums.add(a);
        }
    }
}