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<Integer> list = new ArrayList<>();

        list.add(0, S);

        sc.close();

        int ans = 1;
        int i = 1;
        while (true) {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        }

        System.out.println(ans + 1);
    }
} 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<Integer> list = new ArrayList<>();

        list.add(0, S);

        sc.close();

        int ans = 1;
        int i = 1;
        while (true) {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        }

        System.out.println(ans + 1);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();

        list.add(0, S);

        sc.close();

        int ans = 1;
        int i = 1;
        while (true) {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        }

        System.out.println(ans + 1);
    } main {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();

        list.add(0, S);

        sc.close();

        int ans = 1;
        int i = 1;
        while (true) {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        }

        System.out.println(ans + 1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int S = sc.nextInt(); S sc.nextInt() sc.nextInt sc ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(0, S) list.add list 0 S sc.close() sc.close sc int ans = 1; ans 1 int i = 1; i 1 while (true) {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        } true {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        } int tmp = list.get(i - 1); tmp list.get(i - 1) list.get list i - 1 i 1 if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            } tmp % 2 == 0 tmp % 2 tmp 2 0 {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                } list.contains(tmp / 2) && i > 1 list.contains(tmp / 2) list.contains list tmp / 2 tmp 2 i > 1 i 1 {
                    ans = i;
                    break;
                } ans = i ans i break; list.add(i, tmp / 2) list.add list i tmp / 2 tmp 2 {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            } if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                } list.contains(3 * tmp + 1) && i > 1 list.contains(3 * tmp + 1) list.contains list 3 * tmp + 1 3 * tmp 3 tmp 1 i > 1 i 1 {
                    ans = i;
                    break;
                } ans = i ans i break; list.add(i, 3 * tmp + 1) list.add list i 3 * tmp + 1 3 * tmp 3 tmp 1 i++ i System.out.println(ans + 1) System.out.println System.out System System.out ans + 1 ans 1 String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();

        list.add(0, S);

        sc.close();

        int ans = 1;
        int i = 1;
        while (true) {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        }

        System.out.println(ans + 1);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();

        list.add(0, S);

        sc.close();

        int ans = 1;
        int i = 1;
        while (true) {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        }

        System.out.println(ans + 1);
    }
} 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<Integer> list = new ArrayList<>();

        list.add(0, S);

        sc.close();

        int ans = 1;
        int i = 1;
        while (true) {
            int tmp = list.get(i - 1);

            if (tmp % 2 == 0) {
                if (list.contains(tmp / 2) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, tmp / 2);
            } else {
                if (list.contains(3 * tmp + 1) && i > 1) {
                    ans = i;
                    break;
                }
                list.add(i, 3 * tmp + 1);
            }
            i++;
        }

        System.out.println(ans + 1);
    }
}