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

public class Main {

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

        Set<Integer> set = new HashSet<>();
        int prev = s;
        for (int i = 2; i <= 1000000; i++) {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        }
    }

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

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

        Set<Integer> set = new HashSet<>();
        int prev = s;
        for (int i = 2; i <= 1000000; i++) {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        }
    }

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

        Set<Integer> set = new HashSet<>();
        int prev = s;
        for (int i = 2; i <= 1000000; i++) {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        sc.close();

        Set<Integer> set = new HashSet<>();
        int prev = s;
        for (int i = 2; i <= 1000000; i++) {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc sc.close() sc.close sc Set<Integer> set = new HashSet<>(); set new HashSet<>() int prev = s; prev s for (int i = 2; i <= 1000000; i++) {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        } int i = 2; int i = 2; i 2 i <= 1000000 i 1000000 i++ i++ i {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        } {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        } set.add(prev) set.add set prev int next = f(prev); next f(prev) f prev if (set.contains(next)) {
                System.out.println(i);
                break;
            } set.contains(next) set.contains set next {
                System.out.println(i);
                break;
            } System.out.println(i) System.out.println System.out System System.out i break; prev = next prev next String[] args args static int f(int input) {
        if (input % 2 == 0) {
            return input / 2;
        } else {
            return 3 * input + 1;
        }
    } f {
        if (input % 2 == 0) {
            return input / 2;
        } else {
            return 3 * input + 1;
        }
    } if (input % 2 == 0) {
            return input / 2;
        } else {
            return 3 * input + 1;
        } input % 2 == 0 input % 2 input 2 0 {
            return input / 2;
        } return input / 2; input / 2 input 2 {
            return 3 * input + 1;
        } return 3 * input + 1; 3 * input + 1 3 * input 3 input 1 int input input public class Main {

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

        Set<Integer> set = new HashSet<>();
        int prev = s;
        for (int i = 2; i <= 1000000; i++) {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        }
    }

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

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

        Set<Integer> set = new HashSet<>();
        int prev = s;
        for (int i = 2; i <= 1000000; i++) {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        }
    }

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

public class Main {

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

        Set<Integer> set = new HashSet<>();
        int prev = s;
        for (int i = 2; i <= 1000000; i++) {
            set.add(prev);
            int next = f(prev);
            if (set.contains(next)) {
                System.out.println(i);
                break;
            }
            prev = next;
        }
    }

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