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

public class Main {
    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final int result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();

        sc.close();
        return new TestCase(s);
    }

    public static int process(TestCase testCase) {
        int s = testCase.s;
        Set<Integer> appeared = new HashSet<>();
        int count = 1;

        while (!appeared.contains(s)) {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        }
        return count;
    }

    private static int handleOdd(int s) {
        return 3 * s + 1;
    }

    private static int handleEven(int s) {
        return s / 2;
    }

    private static void output(int result) {
        System.out.println(result);
    }

    public static class TestCase {
        final int s;

        public TestCase(int s) {
            this.s = s;
        }
    }
} 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) {
        TestCase testCase = readFromInput();

        final int result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();

        sc.close();
        return new TestCase(s);
    }

    public static int process(TestCase testCase) {
        int s = testCase.s;
        Set<Integer> appeared = new HashSet<>();
        int count = 1;

        while (!appeared.contains(s)) {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        }
        return count;
    }

    private static int handleOdd(int s) {
        return 3 * s + 1;
    }

    private static int handleEven(int s) {
        return s / 2;
    }

    private static void output(int result) {
        System.out.println(result);
    }

    public static class TestCase {
        final int s;

        public TestCase(int s) {
            this.s = s;
        }
    }
} Main public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final int result = process(testCase);

        output(result);
    } main {
        TestCase testCase = readFromInput();

        final int result = process(testCase);

        output(result);
    } TestCase testCase = readFromInput(); testCase readFromInput() readFromInput final int result = process(testCase); result process(testCase) process testCase output(result) output result String[] args args private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();

        sc.close();
        return new TestCase(s);
    } readFromInput {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();

        sc.close();
        return new TestCase(s);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc sc.close() sc.close sc return new TestCase(s); new TestCase(s) public static int process(TestCase testCase) {
        int s = testCase.s;
        Set<Integer> appeared = new HashSet<>();
        int count = 1;

        while (!appeared.contains(s)) {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        }
        return count;
    } process {
        int s = testCase.s;
        Set<Integer> appeared = new HashSet<>();
        int count = 1;

        while (!appeared.contains(s)) {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        }
        return count;
    } int s = testCase.s; s testCase.s testCase testCase.s Set<Integer> appeared = new HashSet<>(); appeared new HashSet<>() int count = 1; count 1 while (!appeared.contains(s)) {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        } !appeared.contains(s) appeared.contains(s) appeared.contains appeared s {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        } count++ count appeared.add(s) appeared.add appeared s boolean isOdd = (s % 2) != 0; isOdd (s % 2) != 0 (s % 2) s 2 0 if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            } isOdd {
                s = handleOdd(s);
            } s = handleOdd(s) s handleOdd(s) handleOdd s {
                s = handleEven(s);
            } s = handleEven(s) s handleEven(s) handleEven s return count; count TestCase testCase testCase private static int handleOdd(int s) {
        return 3 * s + 1;
    } handleOdd {
        return 3 * s + 1;
    } return 3 * s + 1; 3 * s + 1 3 * s 3 s 1 int s s private static int handleEven(int s) {
        return s / 2;
    } handleEven {
        return s / 2;
    } return s / 2; s / 2 s 2 int s s private static void output(int result) {
        System.out.println(result);
    } output {
        System.out.println(result);
    } System.out.println(result) System.out.println System.out System System.out result int result result public static class TestCase {
        final int s;

        public TestCase(int s) {
            this.s = s;
        }
    } TestCase final int s; s public TestCase(int s) {
            this.s = s;
        } TestCase {
            this.s = s;
        } this.s = s this.s this this.s s int s s public class Main {
    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final int result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();

        sc.close();
        return new TestCase(s);
    }

    public static int process(TestCase testCase) {
        int s = testCase.s;
        Set<Integer> appeared = new HashSet<>();
        int count = 1;

        while (!appeared.contains(s)) {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        }
        return count;
    }

    private static int handleOdd(int s) {
        return 3 * s + 1;
    }

    private static int handleEven(int s) {
        return s / 2;
    }

    private static void output(int result) {
        System.out.println(result);
    }

    public static class TestCase {
        final int s;

        public TestCase(int s) {
            this.s = s;
        }
    }
} public class Main {
    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final int result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();

        sc.close();
        return new TestCase(s);
    }

    public static int process(TestCase testCase) {
        int s = testCase.s;
        Set<Integer> appeared = new HashSet<>();
        int count = 1;

        while (!appeared.contains(s)) {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        }
        return count;
    }

    private static int handleOdd(int s) {
        return 3 * s + 1;
    }

    private static int handleEven(int s) {
        return s / 2;
    }

    private static void output(int result) {
        System.out.println(result);
    }

    public static class TestCase {
        final int s;

        public TestCase(int s) {
            this.s = s;
        }
    }
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final int result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int s = sc.nextInt();

        sc.close();
        return new TestCase(s);
    }

    public static int process(TestCase testCase) {
        int s = testCase.s;
        Set<Integer> appeared = new HashSet<>();
        int count = 1;

        while (!appeared.contains(s)) {
            count++;
            appeared.add(s);

            boolean isOdd = (s % 2) != 0;
            if (isOdd) {
                s = handleOdd(s);
            } else {
                s = handleEven(s);
            }
        }
        return count;
    }

    private static int handleOdd(int s) {
        return 3 * s + 1;
    }

    private static int handleEven(int s) {
        return s / 2;
    }

    private static void output(int result) {
        System.out.println(result);
    }

    public static class TestCase {
        final int s;

        public TestCase(int s) {
            this.s = s;
        }
    }
}
