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

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

        int s = sc.nextInt();

        System.out.println(solve(s));

        sc.close();
    }

    static int solve(int s) {
        Set<Integer> seen = new HashSet<>();
        seen.add(s);
        int current = s;
        for (int m = 2;; ++m) {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

            seen.add(current);
        }
    }
} 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 sc = new Scanner(System.in);

        int s = sc.nextInt();

        System.out.println(solve(s));

        sc.close();
    }

    static int solve(int s) {
        Set<Integer> seen = new HashSet<>();
        seen.add(s);
        int current = s;
        for (int m = 2;; ++m) {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

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

        int s = sc.nextInt();

        System.out.println(solve(s));

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();

        System.out.println(solve(s));

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc System.out.println(solve(s)) System.out.println System.out System System.out solve(s) solve s sc.close() sc.close sc String[] args args static int solve(int s) {
        Set<Integer> seen = new HashSet<>();
        seen.add(s);
        int current = s;
        for (int m = 2;; ++m) {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

            seen.add(current);
        }
    } solve {
        Set<Integer> seen = new HashSet<>();
        seen.add(s);
        int current = s;
        for (int m = 2;; ++m) {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

            seen.add(current);
        }
    } Set<Integer> seen = new HashSet<>(); seen new HashSet<>() seen.add(s) seen.add seen s int current = s; current s for (int m = 2;; ++m) {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

            seen.add(current);
        } int m = 2; int m = 2; m 2 ++m ++m m {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

            seen.add(current);
        } {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

            seen.add(current);
        } current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1) current (current % 2 == 0) ? (current / 2) : (current * 3 + 1) (current % 2 == 0) current % 2 current 2 0 (current / 2) current 2 (current * 3 + 1) current * 3 current 3 1 if (seen.contains(current)) {
                return m;
            } seen.contains(current) seen.contains seen current {
                return m;
            } return m; m seen.add(current) seen.add seen current 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(solve(s));

        sc.close();
    }

    static int solve(int s) {
        Set<Integer> seen = new HashSet<>();
        seen.add(s);
        int current = s;
        for (int m = 2;; ++m) {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

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

        int s = sc.nextInt();

        System.out.println(solve(s));

        sc.close();
    }

    static int solve(int s) {
        Set<Integer> seen = new HashSet<>();
        seen.add(s);
        int current = s;
        for (int m = 2;; ++m) {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

            seen.add(current);
        }
    }
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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

        int s = sc.nextInt();

        System.out.println(solve(s));

        sc.close();
    }

    static int solve(int s) {
        Set<Integer> seen = new HashSet<>();
        seen.add(s);
        int current = s;
        for (int m = 2;; ++m) {
            current = (current % 2 == 0) ? (current / 2) : (current * 3 + 1);
            if (seen.contains(current)) {
                return m;
            }

            seen.add(current);
        }
    }
}