import java.util.*;

public class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 1;
        int MAXN = (int)1e6;
        boolean[] present = new boolean[MAXN];
        while (true) {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        }
        System.out.println(ans);
        sc.close();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 1;
        int MAXN = (int)1e6;
        boolean[] present = new boolean[MAXN];
        while (true) {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        }
        System.out.println(ans);
        sc.close();
    }
} Main public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 1;
        int MAXN = (int)1e6;
        boolean[] present = new boolean[MAXN];
        while (true) {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        }
        System.out.println(ans);
        sc.close();
    } main {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 1;
        int MAXN = (int)1e6;
        boolean[] present = new boolean[MAXN];
        while (true) {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        }
        System.out.println(ans);
        sc.close();
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = 1; ans 1 int MAXN = (int)1e6; MAXN (int)1e6 boolean[] present = new boolean[MAXN]; present new boolean[MAXN] MAXN while (true) {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        } true {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        } if (present[n]) {
                break;
            } present[n] present n {
                break;
            } break; present[n] = true present[n] present n true if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2; (n & 1) == 1 (n & 1) n 1 1 n = 3 * n + 1 n 3 * n + 1 3 * n 3 n 1 n /= 2 n 2 ans += 1 ans 1 System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 1;
        int MAXN = (int)1e6;
        boolean[] present = new boolean[MAXN];
        while (true) {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        }
        System.out.println(ans);
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 1;
        int MAXN = (int)1e6;
        boolean[] present = new boolean[MAXN];
        while (true) {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        }
        System.out.println(ans);
        sc.close();
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 1;
        int MAXN = (int)1e6;
        boolean[] present = new boolean[MAXN];
        while (true) {
            if (present[n]) {
                break;
            }
            present[n] = true;
            if ((n & 1) == 1) n = 3 * n + 1;
            else n /= 2;
            ans += 1;
        }
        System.out.println(ans);
        sc.close();
    }
}