import java.util.Scanner;

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

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        }
    }

    private static int f(int n) {
        return n % 2 == 0 ? (n / 2) : (3 * n + 1);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int s = in.nextInt();

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        }
    }

    private static int f(int n) {
        return n % 2 == 0 ? (n / 2) : (3 * n + 1);
    }
} Main public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int s = in.nextInt();

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int s = in.nextInt();

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        }
    } try (Scanner in = new Scanner(System.in)) {
            int s = in.nextInt();

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        } {
            int s = in.nextInt();

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int s = in.nextInt(); s in.nextInt() in.nextInt in boolean[] used = new boolean[1 << 20]; used new boolean[1 << 20] 1 << 20 1 20 int a = s; a s int n = 1; n 1 used[a] = true used[a] used a true for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            } ; {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            } {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            } a = f(a) a f(a) f a n++ n if (used[a]) {
                    System.out.println(n);
                    return;
                } used[a] used a {
                    System.out.println(n);
                    return;
                } System.out.println(n) System.out.println System.out System System.out n return; used[a] = true used[a] used a true String args[] args private static int f(int n) {
        return n % 2 == 0 ? (n / 2) : (3 * n + 1);
    } f {
        return n % 2 == 0 ? (n / 2) : (3 * n + 1);
    } return n % 2 == 0 ? (n / 2) : (3 * n + 1); n % 2 == 0 ? (n / 2) : (3 * n + 1) n % 2 == 0 n % 2 n 2 0 (n / 2) n 2 (3 * n + 1) 3 * n 3 n 1 int n n public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int s = in.nextInt();

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        }
    }

    private static int f(int n) {
        return n % 2 == 0 ? (n / 2) : (3 * n + 1);
    }
} public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int s = in.nextInt();

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        }
    }

    private static int f(int n) {
        return n % 2 == 0 ? (n / 2) : (3 * n + 1);
    }
} Main
import java.util.Scanner;

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

            boolean[] used = new boolean[1 << 20];

            int a = s;
            int n = 1;
            used[a] = true;

            for (;;) {
                a = f(a);
                n++;
                if (used[a]) {
                    System.out.println(n);
                    return;
                }
                used[a] = true;
            }
        }
    }

    private static int f(int n) {
        return n % 2 == 0 ? (n / 2) : (3 * n + 1);
    }
}
