import java.util.Scanner;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        a.add(s);
        int len = 1000000;
        for (int i = 1; i <= len; i++) {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        }
        int ans = 0;
        for (int i = 0; i <= len; i++) {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        }
    }
} import java.util.Scanner; Scanner java.util import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        a.add(s);
        int len = 1000000;
        for (int i = 1; i <= len; i++) {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        }
        int ans = 0;
        for (int i = 0; i <= len; i++) {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        a.add(s);
        int len = 1000000;
        for (int i = 1; i <= len; i++) {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        }
        int ans = 0;
        for (int i = 0; i <= len; i++) {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        a.add(s);
        int len = 1000000;
        for (int i = 1; i <= len; i++) {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        }
        int ans = 0;
        for (int i = 0; i <= len; i++) {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc List<Integer> a = new ArrayList<>(); a new ArrayList<>() a.add(s) a.add a s int len = 1000000; len 1000000 for (int i = 1; i <= len; i++) {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        } int i = 1; int i = 1; i 1 i <= len i len i++ i++ i {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        } {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        } int f; f if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            } a.get(i - 1) % 2 == 0 a.get(i - 1) % 2 a.get(i - 1) a.get a i - 1 i 1 2 0 {
                f = a.get(i - 1) / 2;
            } f = a.get(i - 1) / 2 f a.get(i - 1) / 2 a.get(i - 1) a.get a i - 1 i 1 2 {
                f = 3 * a.get(i - 1) + 1;
            } f = 3 * a.get(i - 1) + 1 f 3 * a.get(i - 1) + 1 3 * a.get(i - 1) 3 a.get(i - 1) a.get a i - 1 i 1 1 a.add(f) a.add a f int ans = 0; ans 0 for (int i = 0; i <= len; i++) {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        } int i = 0; int i = 0; i 0 i <= len i len i++ i++ i {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        } {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        } for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            } int j = i + 1; int j = i + 1; j i + 1 i 1 j <= len j len j++ j++ j {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            } {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            } if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                } a.get(i) == a.get(j) a.get(i) a.get a i a.get(j) a.get a j {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                } ans = j + 1 ans j + 1 j 1 System.out.println(ans) System.out.println System.out System System.out ans return; String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        a.add(s);
        int len = 1000000;
        for (int i = 1; i <= len; i++) {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        }
        int ans = 0;
        for (int i = 0; i <= len; i++) {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        a.add(s);
        int len = 1000000;
        for (int i = 1; i <= len; i++) {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        }
        int ans = 0;
        for (int i = 0; i <= len; i++) {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        }
    }
} Main
import java.util.Scanner;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        a.add(s);
        int len = 1000000;
        for (int i = 1; i <= len; i++) {
            int f;
            if (a.get(i - 1) % 2 == 0) {
                f = a.get(i - 1) / 2;
            } else {
                f = 3 * a.get(i - 1) + 1;
            }
            a.add(f);
        }
        int ans = 0;
        for (int i = 0; i <= len; i++) {
            for (int j = i + 1; j <= len; j++) {
                if (a.get(i) == a.get(j)) {
                    // System.out.printf("i = %d,j = %d %n", i, j);
                    // System.out.printf("a = %d,a = %d %n", a.get(i), a.get(j));
                    ans = j + 1;
                    System.out.println(ans);
                    return;
                }
            }
        }
    }
}
