import java.util.HashSet;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = Integer.parseInt(scanner.next());
        scanner.close();

        HashSet<Integer> set = new HashSet<>();
        set.add(s);

        for (int i = 2; i <= 1000001; i++) {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        }
    }

    private static int f(int n) {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    }
}
 import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = Integer.parseInt(scanner.next());
        scanner.close();

        HashSet<Integer> set = new HashSet<>();
        set.add(s);

        for (int i = 2; i <= 1000001; i++) {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        }
    }

    private static int f(int n) {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = Integer.parseInt(scanner.next());
        scanner.close();

        HashSet<Integer> set = new HashSet<>();
        set.add(s);

        for (int i = 2; i <= 1000001; i++) {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        int s = Integer.parseInt(scanner.next());
        scanner.close();

        HashSet<Integer> set = new HashSet<>();
        set.add(s);

        for (int i = 2; i <= 1000001; i++) {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int s = Integer.parseInt(scanner.next()); s Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner scanner.close() scanner.close scanner HashSet<Integer> set = new HashSet<>(); set new HashSet<>() set.add(s) set.add set s for (int i = 2; i <= 1000001; i++) {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        } int i = 2; int i = 2; i 2 i <= 1000001 i 1000001 i++ i++ i {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        } {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        } s = f(s) s f(s) f s if (!set.add(s)) {
                System.out.println(i);
                return;
            } !set.add(s) set.add(s) set.add set s {
                System.out.println(i);
                return;
            } System.out.println(i) System.out.println System.out System System.out i return; String[] args args private static int f(int n) {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    } f {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    } if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        } n % 2 == 0 n % 2 n 2 0 {
            return n / 2;
        } return n / 2; n / 2 n 2 {
            return 3 * n + 1;
        } return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = Integer.parseInt(scanner.next());
        scanner.close();

        HashSet<Integer> set = new HashSet<>();
        set.add(s);

        for (int i = 2; i <= 1000001; i++) {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        }
    }

    private static int f(int n) {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = Integer.parseInt(scanner.next());
        scanner.close();

        HashSet<Integer> set = new HashSet<>();
        set.add(s);

        for (int i = 2; i <= 1000001; i++) {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        }
    }

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

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = Integer.parseInt(scanner.next());
        scanner.close();

        HashSet<Integer> set = new HashSet<>();
        set.add(s);

        for (int i = 2; i <= 1000001; i++) {
            s = f(s);

            if (!set.add(s)) {
                System.out.println(i);
                return;
            }
        }
    }

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

