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();

		int a = s;
		int i = 2;
		int ans = 0;
		Set<Integer> set = new HashSet<>();
		set.add(a);
		while (true) {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		}
		System.out.println(ans);
		sc.close();
	}

	public static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		}
		return 3 * n + 1;
	}
} 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();

		int a = s;
		int i = 2;
		int ans = 0;
		Set<Integer> set = new HashSet<>();
		set.add(a);
		while (true) {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		}
		System.out.println(ans);
		sc.close();
	}

	public static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		}
		return 3 * n + 1;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int s = sc.nextInt();

		int a = s;
		int i = 2;
		int ans = 0;
		Set<Integer> set = new HashSet<>();
		set.add(a);
		while (true) {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		}
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int s = sc.nextInt();

		int a = s;
		int i = 2;
		int ans = 0;
		Set<Integer> set = new HashSet<>();
		set.add(a);
		while (true) {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		}
		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int a = s; a s int i = 2; i 2 int ans = 0; ans 0 Set<Integer> set = new HashSet<>(); set new HashSet<>() set.add(a) set.add set a while (true) {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		} true {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		} a = func(a) a func(a) func a if (!set.add(a)) {
				ans = i;
				break;
			} !set.add(a) set.add(a) set.add set a {
				ans = i;
				break;
			} ans = i ans i break; i++ i System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		}
		return 3 * n + 1;
	} func {
		if (n % 2 == 0) {
			return n / 2;
		}
		return 3 * n + 1;
	} if (n % 2 == 0) {
			return n / 2;
		} n % 2 == 0 n % 2 n 2 0 {
			return n / 2;
		} return n / 2; n / 2 n 2 return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int s = sc.nextInt();

		int a = s;
		int i = 2;
		int ans = 0;
		Set<Integer> set = new HashSet<>();
		set.add(a);
		while (true) {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		}
		System.out.println(ans);
		sc.close();
	}

	public static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		}
		return 3 * n + 1;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int s = sc.nextInt();

		int a = s;
		int i = 2;
		int ans = 0;
		Set<Integer> set = new HashSet<>();
		set.add(a);
		while (true) {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		}
		System.out.println(ans);
		sc.close();
	}

	public static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		}
		return 3 * n + 1;
	}
} 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();

		int a = s;
		int i = 2;
		int ans = 0;
		Set<Integer> set = new HashSet<>();
		set.add(a);
		while (true) {
			a = func(a);
			if (!set.add(a)) {
				ans = i;
				break;
			}
			i++;
		}
		System.out.println(ans);
		sc.close();
	}

	public static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		}
		return 3 * n + 1;
	}
}
