import java.util.Scanner;

public class Main {

    private static int solve(int s) {
        boolean[] appeared = new boolean[1000000];
        int n = 1;

        while (!appeared[s]) {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        }

        return n;
    }

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

        int s = sc.nextInt();
        int ans = solve(s);

        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    private static int solve(int s) {
        boolean[] appeared = new boolean[1000000];
        int n = 1;

        while (!appeared[s]) {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        }

        return n;
    }

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

        int s = sc.nextInt();
        int ans = solve(s);

        System.out.println(ans);
    }
} Main private static int solve(int s) {
        boolean[] appeared = new boolean[1000000];
        int n = 1;

        while (!appeared[s]) {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        }

        return n;
    } solve {
        boolean[] appeared = new boolean[1000000];
        int n = 1;

        while (!appeared[s]) {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        }

        return n;
    } boolean[] appeared = new boolean[1000000]; appeared new boolean[1000000] 1000000 int n = 1; n 1 while (!appeared[s]) {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        } !appeared[s] appeared[s] appeared s {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        } appeared[s] = true appeared[s] appeared s true n += 1 n 1 if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            } s % 2 == 0 s % 2 s 2 0 {
                s = s / 2;
            } s = s / 2 s s / 2 s 2 {
                s = 3 * s + 1;
            } s = 3 * s + 1 s 3 * s + 1 3 * s 3 s 1 return n; n int s s public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        int ans = solve(s);

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        int ans = solve(s);

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int ans = solve(s); ans solve(s) solve s System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    private static int solve(int s) {
        boolean[] appeared = new boolean[1000000];
        int n = 1;

        while (!appeared[s]) {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        }

        return n;
    }

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

        int s = sc.nextInt();
        int ans = solve(s);

        System.out.println(ans);
    }
} public class Main {

    private static int solve(int s) {
        boolean[] appeared = new boolean[1000000];
        int n = 1;

        while (!appeared[s]) {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        }

        return n;
    }

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

        int s = sc.nextInt();
        int ans = solve(s);

        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

    private static int solve(int s) {
        boolean[] appeared = new boolean[1000000];
        int n = 1;

        while (!appeared[s]) {
            appeared[s] = true;
            n += 1;

            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
        }

        return n;
    }

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

        int s = sc.nextInt();
        int ans = solve(s);

        System.out.println(ans);
    }
}
