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

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int s = Integer.parseInt(scanner.nextLine());

		HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();

		int preVal = 0;

		for (int i = 0; i < 1000000; i++) {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		}

	}

	private static int f(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return 3 * n + 1;
		}
	}

} import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int s = Integer.parseInt(scanner.nextLine());

		HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();

		int preVal = 0;

		for (int i = 0; i < 1000000; i++) {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		}

	}

	private static int f(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return 3 * n + 1;
		}
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int s = Integer.parseInt(scanner.nextLine());

		HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();

		int preVal = 0;

		for (int i = 0; i < 1000000; i++) {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		}

	} main {
		Scanner scanner = new Scanner(System.in);

		int s = Integer.parseInt(scanner.nextLine());

		HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();

		int preVal = 0;

		for (int i = 0; i < 1000000; i++) {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		}

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int s = Integer.parseInt(scanner.nextLine()); s Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>(); map new HashMap<Integer, Boolean>() int preVal = 0; preVal 0 for (int i = 0; i < 1000000; i++) {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		} int i = 0; int i = 0; i 0 i < 1000000 i 1000000 i++ i++ i {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		} {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		} if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			} i == 0 i 0 {
				map.put(s, true);
				preVal = s;

				continue;
			} map.put(s, true) map.put map s true preVal = s preVal s continue; int val = f(preVal); val f(preVal) f preVal if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			} map.get(val) != null map.get(val) map.get map val null {
				System.out.println(i + 1);
				return;
			} System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 return; {
				map.put(val, true);
				preVal = val;
			} map.put(val, true) map.put map val true preVal = val preVal val String[] args args private static int f(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return 3 * n + 1;
		}
	} f {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return 3 * n + 1;
		}
	} if (n % 2 == 0) {
			return n / 2;
		} else {
			return 3 * n + 1;
		} n % 2 == 0 n % 2 n 2 0 {
			return n / 2;
		} return n / 2; n / 2 n 2 {
			return 3 * n + 1;
		} 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 scanner = new Scanner(System.in);

		int s = Integer.parseInt(scanner.nextLine());

		HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();

		int preVal = 0;

		for (int i = 0; i < 1000000; i++) {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		}

	}

	private static int f(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return 3 * n + 1;
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int s = Integer.parseInt(scanner.nextLine());

		HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();

		int preVal = 0;

		for (int i = 0; i < 1000000; i++) {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		}

	}

	private static int f(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return 3 * n + 1;
		}
	}

} Main
import java.util.HashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int s = Integer.parseInt(scanner.nextLine());

		HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();

		int preVal = 0;

		for (int i = 0; i < 1000000; i++) {
			if (i == 0) {
				map.put(s, true);
				preVal = s;

				continue;
			}

			int val = f(preVal);
			if (map.get(val) != null) {
				System.out.println(i + 1);
				return;
			} else {
				map.put(val, true);
				preVal = val;
			}
		}

	}

	private static int f(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return 3 * n + 1;
		}
	}

}
