
import java.util.*;

public class Main {

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

    private static int collatz(int s) {

        Set<Integer> elems = new HashSet<>();

        int previous = s;
        int m = 1;

        while (!elems.contains(previous)) {
            elems.add(previous);
            previous = f(previous);
            m++;
        }
        return m;
    }

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

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

    private static int collatz(int s) {

        Set<Integer> elems = new HashSet<>();

        int previous = s;
        int m = 1;

        while (!elems.contains(previous)) {
            elems.add(previous);
            previous = f(previous);
            m++;
        }
        return m;
    }

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

        Set<Integer> elems = new HashSet<>();

        int previous = s;
        int m = 1;

        while (!elems.contains(previous)) {
            elems.add(previous);
            previous = f(previous);
            m++;
        }
        return m;
    } collatz {

        Set<Integer> elems = new HashSet<>();

        int previous = s;
        int m = 1;

        while (!elems.contains(previous)) {
            elems.add(previous);
            previous = f(previous);
            m++;
        }
        return m;
    } Set<Integer> elems = new HashSet<>(); elems new HashSet<>() int previous = s; previous s int m = 1; m 1 while (!elems.contains(previous)) {
            elems.add(previous);
            previous = f(previous);
            m++;
        } !elems.contains(previous) elems.contains(previous) elems.contains elems previous {
            elems.add(previous);
            previous = f(previous);
            m++;
        } elems.add(previous) elems.add elems previous previous = f(previous) previous f(previous) f previous m++ m return m; m int s s private static int f(int s) {
        if (s % 2 == 0) return s / 2;
        else return (3 * s) + 1;
    } f {
        if (s % 2 == 0) return s / 2;
        else return (3 * s) + 1;
    } if (s % 2 == 0) return s / 2;
        else return (3 * s) + 1; s % 2 == 0 s % 2 s 2 0 return s / 2; s / 2 s 2 return (3 * s) + 1; (3 * s) + 1 (3 * s) 3 s 1 int s s public class Main {

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

    private static int collatz(int s) {

        Set<Integer> elems = new HashSet<>();

        int previous = s;
        int m = 1;

        while (!elems.contains(previous)) {
            elems.add(previous);
            previous = f(previous);
            m++;
        }
        return m;
    }

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

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

    private static int collatz(int s) {

        Set<Integer> elems = new HashSet<>();

        int previous = s;
        int m = 1;

        while (!elems.contains(previous)) {
            elems.add(previous);
            previous = f(previous);
            m++;
        }
        return m;
    }

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

import java.util.*;

public class Main {

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

    private static int collatz(int s) {

        Set<Integer> elems = new HashSet<>();

        int previous = s;
        int m = 1;

        while (!elems.contains(previous)) {
            elems.add(previous);
            previous = f(previous);
            m++;
        }
        return m;
    }

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