import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int s = in.nextInt();
		in.close();

		Map<Integer, Integer> map = new HashMap<>();
		map.put(s, 0);
		int result = 0;
		int prev = s;
		for (int i = 1; i <= 1000000; ++i) {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		}
		System.out.println(result + 1);

	}

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

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int s = in.nextInt();
		in.close();

		Map<Integer, Integer> map = new HashMap<>();
		map.put(s, 0);
		int result = 0;
		int prev = s;
		for (int i = 1; i <= 1000000; ++i) {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		}
		System.out.println(result + 1);

	}

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

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

		Map<Integer, Integer> map = new HashMap<>();
		map.put(s, 0);
		int result = 0;
		int prev = s;
		for (int i = 1; i <= 1000000; ++i) {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		}
		System.out.println(result + 1);

	} main {
		Scanner in = new Scanner(System.in);
		int s = in.nextInt();
		in.close();

		Map<Integer, Integer> map = new HashMap<>();
		map.put(s, 0);
		int result = 0;
		int prev = s;
		for (int i = 1; i <= 1000000; ++i) {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		}
		System.out.println(result + 1);

	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int s = in.nextInt(); s in.nextInt() in.nextInt in in.close() in.close in Map<Integer, Integer> map = new HashMap<>(); map new HashMap<>() map.put(s, 0) map.put map s 0 int result = 0; result 0 int prev = s; prev s for (int i = 1; i <= 1000000; ++i) {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		} int i = 1; int i = 1; i 1 i <= 1000000 i 1000000 ++i ++i i {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		} {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		} int next = getNext(prev); next getNext(prev) getNext prev if (map.containsKey(next)) {
				result = i;
				break;
			} map.containsKey(next) map.containsKey map next {
				result = i;
				break;
			} result = i result i break; map.put(next, i) map.put map next i prev = next prev next System.out.println(result + 1) System.out.println System.out System System.out result + 1 result 1 String[] args args private static int getNext(int prev) {
		if (prev % 2 == 0) {
			return prev / 2;
		} else {
			return 3 * prev + 1;
		}
	} getNext {
		if (prev % 2 == 0) {
			return prev / 2;
		} else {
			return 3 * prev + 1;
		}
	} if (prev % 2 == 0) {
			return prev / 2;
		} else {
			return 3 * prev + 1;
		} prev % 2 == 0 prev % 2 prev 2 0 {
			return prev / 2;
		} return prev / 2; prev / 2 prev 2 {
			return 3 * prev + 1;
		} return 3 * prev + 1; 3 * prev + 1 3 * prev 3 prev 1 int prev prev public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int s = in.nextInt();
		in.close();

		Map<Integer, Integer> map = new HashMap<>();
		map.put(s, 0);
		int result = 0;
		int prev = s;
		for (int i = 1; i <= 1000000; ++i) {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		}
		System.out.println(result + 1);

	}

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

} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int s = in.nextInt();
		in.close();

		Map<Integer, Integer> map = new HashMap<>();
		map.put(s, 0);
		int result = 0;
		int prev = s;
		for (int i = 1; i <= 1000000; ++i) {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		}
		System.out.println(result + 1);

	}

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

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int s = in.nextInt();
		in.close();

		Map<Integer, Integer> map = new HashMap<>();
		map.put(s, 0);
		int result = 0;
		int prev = s;
		for (int i = 1; i <= 1000000; ++i) {
			int next = getNext(prev);
			if (map.containsKey(next)) {
				result = i;
				break;
			}
			map.put(next, i);
			prev = next;
		}
		System.out.println(result + 1);

	}

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

}