import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int s = sc.nextInt();
		int[] a = new int[1000000];
		a[0] = s;
		HashMap<Integer, Integer> hm = new HashMap<>();
		hm.put(a[0], 0);
		for (int i = 1; i < 1000000; i++) {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		}
	}
} import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int s = sc.nextInt();
		int[] a = new int[1000000];
		a[0] = s;
		HashMap<Integer, Integer> hm = new HashMap<>();
		hm.put(a[0], 0);
		for (int i = 1; i < 1000000; i++) {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int s = sc.nextInt();
		int[] a = new int[1000000];
		a[0] = s;
		HashMap<Integer, Integer> hm = new HashMap<>();
		hm.put(a[0], 0);
		for (int i = 1; i < 1000000; i++) {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int s = sc.nextInt();
		int[] a = new int[1000000];
		a[0] = s;
		HashMap<Integer, Integer> hm = new HashMap<>();
		hm.put(a[0], 0);
		for (int i = 1; i < 1000000; i++) {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int[] a = new int[1000000]; a new int[1000000] 1000000 a[0] = s a[0] a 0 s HashMap<Integer, Integer> hm = new HashMap<>(); hm new HashMap<>() hm.put(a[0], 0) hm.put hm a[0] a 0 0 for (int i = 1; i < 1000000; i++) {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		} int i = 1; int i = 1; i 1 i < 1000000 i 1000000 i++ i++ i {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		} {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		} if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			} a[i - 1] % 2 == 0 a[i - 1] % 2 a[i - 1] a i - 1 i 1 2 0 {
				a[i] = a[i - 1] / 2;
			} a[i] = a[i - 1] / 2 a[i] a i a[i - 1] / 2 a[i - 1] a i - 1 i 1 2 {
				a[i] = 3 * a[i - 1] + 1;
			} a[i] = 3 * a[i - 1] + 1 a[i] a i 3 * a[i - 1] + 1 3 * a[i - 1] 3 a[i - 1] a i - 1 i 1 1 if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			} hm.containsKey(a[i]) hm.containsKey hm a[i] a i {
				System.out.println(i + 1);
				break;
			} System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 break; {
				hm.put(a[i], i);
			} hm.put(a[i], i) hm.put hm a[i] a i i String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int s = sc.nextInt();
		int[] a = new int[1000000];
		a[0] = s;
		HashMap<Integer, Integer> hm = new HashMap<>();
		hm.put(a[0], 0);
		for (int i = 1; i < 1000000; i++) {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int s = sc.nextInt();
		int[] a = new int[1000000];
		a[0] = s;
		HashMap<Integer, Integer> hm = new HashMap<>();
		hm.put(a[0], 0);
		for (int i = 1; i < 1000000; i++) {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		}
	}
} Main
import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int s = sc.nextInt();
		int[] a = new int[1000000];
		a[0] = s;
		HashMap<Integer, Integer> hm = new HashMap<>();
		hm.put(a[0], 0);
		for (int i = 1; i < 1000000; i++) {
			if (a[i - 1] % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (hm.containsKey(a[i])) {
				System.out.println(i + 1);
				break;
			} else {
				hm.put(a[i], i);
			}
		}
	}
}
