import java.util.*;

public class Main {
    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        int result = 0;
        set.add(s);
        for (int i = 2; i < 1000000; i++) {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        }
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        int result = 0;
        set.add(s);
        for (int i = 2; i < 1000000; i++) {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        int result = 0;
        set.add(s);
        for (int i = 2; i < 1000000; i++) {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        }
        System.out.println(result);
    } main {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        int result = 0;
        set.add(s);
        for (int i = 2; i < 1000000; i++) {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        }
        System.out.println(result);
    } @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Set<Integer> set = new HashSet<Integer>(); set new HashSet<Integer>() int result = 0; result 0 set.add(s) set.add set s for (int i = 2; i < 1000000; i++) {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        } int i = 2; int i = 2; i 2 i < 1000000 i 1000000 i++ i++ i {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        } {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        } s = s % 2 == 0 ? (s / 2) : (3 * s + 1) s s % 2 == 0 ? (s / 2) : (3 * s + 1) s % 2 == 0 s % 2 s 2 0 (s / 2) s 2 (3 * s + 1) 3 * s 3 s 1 if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            } set.contains(s) set.contains set s {
                result = i;
                break;
            } result = i result i break; {
                set.add(s);
            } set.add(s) set.add set s System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        int result = 0;
        set.add(s);
        for (int i = 2; i < 1000000; i++) {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        int result = 0;
        set.add(s);
        for (int i = 2; i < 1000000; i++) {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        }
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        int result = 0;
        set.add(s);
        for (int i = 2; i < 1000000; i++) {
            s = s % 2 == 0 ? (s / 2) : (3 * s + 1);
            if (set.contains(s)) {
                result = i;
                break;
            } else {
                set.add(s);
            }
        }
        System.out.println(result);
    }
}
