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

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

        int s = sc.nextInt();
        ArrayList list = new ArrayList<Integer>();

        list.add(s);

        int ans = 0;
        for (int i = 0; i <= 1000000; i++) {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        }

        System.out.println(ans);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        ArrayList list = new ArrayList<Integer>();

        list.add(s);

        int ans = 0;
        for (int i = 0; i <= 1000000; i++) {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        ArrayList list = new ArrayList<Integer>();

        list.add(s);

        int ans = 0;
        for (int i = 0; i <= 1000000; i++) {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        }

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

        int s = sc.nextInt();
        ArrayList list = new ArrayList<Integer>();

        list.add(s);

        int ans = 0;
        for (int i = 0; i <= 1000000; i++) {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        }

        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 ArrayList list = new ArrayList<Integer>(); list new ArrayList<Integer>() list.add(s) list.add list s int ans = 0; ans 0 for (int i = 0; i <= 1000000; i++) {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        } int i = 0; int i = 0; i 0 i <= 1000000 i 1000000 i++ i++ i {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        } {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        } if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            } (int)list.get(i) % 2 == 0 (int)list.get(i) % 2 (int)list.get(i) list.get list i 2 0 {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                } list.contains((int)list.get(i) / 2) list.contains list (int)list.get(i) / 2 (int)list.get(i) list.get list i 2 {
                    ans = i + 2;
                    break;
                } ans = i + 2 ans i + 2 i 2 break; list.add((int)list.get(i) / 2) list.add list (int)list.get(i) / 2 (int)list.get(i) list.get list i 2 {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            } if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                } list.contains(3 * (int)list.get(i) + 1) list.contains list 3 * (int)list.get(i) + 1 3 * (int)list.get(i) 3 (int)list.get(i) list.get list i 1 {
                    ans = i + 2;
                    break;
                } ans = i + 2 ans i + 2 i 2 break; list.add(3 * (int)list.get(i) + 1) list.add list 3 * (int)list.get(i) + 1 3 * (int)list.get(i) 3 (int)list.get(i) list.get list i 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        ArrayList list = new ArrayList<Integer>();

        list.add(s);

        int ans = 0;
        for (int i = 0; i <= 1000000; i++) {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        }

        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();
        ArrayList list = new ArrayList<Integer>();

        list.add(s);

        int ans = 0;
        for (int i = 0; i <= 1000000; i++) {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        }

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

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

        int s = sc.nextInt();
        ArrayList list = new ArrayList<Integer>();

        list.add(s);

        int ans = 0;
        for (int i = 0; i <= 1000000; i++) {
            if ((int)list.get(i) % 2 == 0) {
                if (list.contains((int)list.get(i) / 2)) {
                    ans = i + 2;
                    break;
                }
                list.add((int)list.get(i) / 2);
            } else {
                if (list.contains(3 * (int)list.get(i) + 1)) {
                    ans = i + 2;
                    break;
                }
                list.add(3 * (int)list.get(i) + 1);
            }
        }

        System.out.println(ans);
    }
}
