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

public class Main {

    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        int prev = reader.nextInt();
        reader.close();
        Set<Integer> numbers = new HashSet<>();
        int i = 1;
        do {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } while (!numbers.contains(prev));
        System.out.println(i);
    }

    private static int f(int n) {
        return n % 2 == 0 ? n / 2 : 3 * n + 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 reader = new Scanner(System.in);
        int prev = reader.nextInt();
        reader.close();
        Set<Integer> numbers = new HashSet<>();
        int i = 1;
        do {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } while (!numbers.contains(prev));
        System.out.println(i);
    }

    private static int f(int n) {
        return n % 2 == 0 ? n / 2 : 3 * n + 1;
    }
} Main public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        int prev = reader.nextInt();
        reader.close();
        Set<Integer> numbers = new HashSet<>();
        int i = 1;
        do {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } while (!numbers.contains(prev));
        System.out.println(i);
    } main {
        Scanner reader = new Scanner(System.in);
        int prev = reader.nextInt();
        reader.close();
        Set<Integer> numbers = new HashSet<>();
        int i = 1;
        do {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } while (!numbers.contains(prev));
        System.out.println(i);
    } Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int prev = reader.nextInt(); prev reader.nextInt() reader.nextInt reader reader.close() reader.close reader Set<Integer> numbers = new HashSet<>(); numbers new HashSet<>() int i = 1; i 1 do {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } while (!numbers.contains(prev)); !numbers.contains(prev) numbers.contains(prev) numbers.contains numbers prev {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } ++i i numbers.add(prev) numbers.add numbers prev prev = f(prev) prev f(prev) f prev System.out.println(i) System.out.println System.out System System.out i 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) {
        Scanner reader = new Scanner(System.in);
        int prev = reader.nextInt();
        reader.close();
        Set<Integer> numbers = new HashSet<>();
        int i = 1;
        do {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } while (!numbers.contains(prev));
        System.out.println(i);
    }

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

    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        int prev = reader.nextInt();
        reader.close();
        Set<Integer> numbers = new HashSet<>();
        int i = 1;
        do {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } while (!numbers.contains(prev));
        System.out.println(i);
    }

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

public class Main {

    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        int prev = reader.nextInt();
        reader.close();
        Set<Integer> numbers = new HashSet<>();
        int i = 1;
        do {
            ++i;
            numbers.add(prev);
            prev = f(prev);
        } while (!numbers.contains(prev));
        System.out.println(i);
    }

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