import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        Integer s = Integer.parseInt(sc.next());

        // 主処理
        List<Integer> list = new ArrayList<>();
        list.add(s);

        int result = 0;
        boolean doContinue = true;
        for (int i = 0; doContinue; i++) {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        }

        // 出力
        System.out.println(result);
        sc.close();
    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        Integer s = Integer.parseInt(sc.next());

        // 主処理
        List<Integer> list = new ArrayList<>();
        list.add(s);

        int result = 0;
        boolean doContinue = true;
        for (int i = 0; doContinue; i++) {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        }

        // 出力
        System.out.println(result);
        sc.close();
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        Integer s = Integer.parseInt(sc.next());

        // 主処理
        List<Integer> list = new ArrayList<>();
        list.add(s);

        int result = 0;
        boolean doContinue = true;
        for (int i = 0; doContinue; i++) {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        }

        // 出力
        System.out.println(result);
        sc.close();
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        Integer s = Integer.parseInt(sc.next());

        // 主処理
        List<Integer> list = new ArrayList<>();
        list.add(s);

        int result = 0;
        boolean doContinue = true;
        for (int i = 0; doContinue; i++) {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        }

        // 出力
        System.out.println(result);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Integer s = Integer.parseInt(sc.next()); s Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(s) list.add list s int result = 0; result 0 boolean doContinue = true; doContinue true for (int i = 0; doContinue; i++) {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        } int i = 0; int i = 0; i 0 doContinue i++ i++ i {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        } {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        } if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            } s % 2 == 0 s % 2 s 2 0 {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                } list.contains(s / 2) list.contains list s / 2 s 2 {
                    result = i + 2;
                    doContinue = false;
                } result = i + 2 result i + 2 i 2 doContinue = false doContinue false {
                    s = s / 2;
                    list.add(s);
                } s = s / 2 s s / 2 s 2 list.add(s) list.add list s {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            } if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                } list.contains(3 * s + 1) list.contains list 3 * s + 1 3 * s 3 s 1 {
                    result = i + 2;
                    doContinue = false;
                } result = i + 2 result i + 2 i 2 doContinue = false doContinue false {
                    s = 3 * s + 1;
                    list.add(s);
                } s = 3 * s + 1 s 3 * s + 1 3 * s 3 s 1 list.add(s) list.add list s System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        Integer s = Integer.parseInt(sc.next());

        // 主処理
        List<Integer> list = new ArrayList<>();
        list.add(s);

        int result = 0;
        boolean doContinue = true;
        for (int i = 0; doContinue; i++) {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        }

        // 出力
        System.out.println(result);
        sc.close();
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        Integer s = Integer.parseInt(sc.next());

        // 主処理
        List<Integer> list = new ArrayList<>();
        list.add(s);

        int result = 0;
        boolean doContinue = true;
        for (int i = 0; doContinue; i++) {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        }

        // 出力
        System.out.println(result);
        sc.close();
    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        Integer s = Integer.parseInt(sc.next());

        // 主処理
        List<Integer> list = new ArrayList<>();
        list.add(s);

        int result = 0;
        boolean doContinue = true;
        for (int i = 0; doContinue; i++) {
            if (s % 2 == 0) {
                if (list.contains(s / 2)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = s / 2;
                    list.add(s);
                }
            } else {
                if (list.contains(3 * s + 1)) {
                    result = i + 2;
                    doContinue = false;
                } else {
                    s = 3 * s + 1;
                    list.add(s);
                }
            }
        }

        // 出力
        System.out.println(result);
        sc.close();
    }
}
