import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int s = Integer.parseInt(str[0]);

		HashSet<Integer> set = new HashSet<>();
		set.add(s);

		for (int i = 1;; i++) {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		}
	}

	static int calc(int a) {
		if (a % 2 == 0) {
			return a / 2;
		} else {
			return 3 * a + 1;
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashSet; HashSet java.util public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int s = Integer.parseInt(str[0]);

		HashSet<Integer> set = new HashSet<>();
		set.add(s);

		for (int i = 1;; i++) {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		}
	}

	static int calc(int a) {
		if (a % 2 == 0) {
			return a / 2;
		} else {
			return 3 * a + 1;
		}
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int s = Integer.parseInt(str[0]);

		HashSet<Integer> set = new HashSet<>();
		set.add(s);

		for (int i = 1;; i++) {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int s = Integer.parseInt(str[0]);

		HashSet<Integer> set = new HashSet<>();
		set.add(s);

		for (int i = 1;; i++) {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int s = Integer.parseInt(str[0]); s Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 HashSet<Integer> set = new HashSet<>(); set new HashSet<>() set.add(s) set.add set s for (int i = 1;; i++) {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		} int i = 1; int i = 1; i 1 i++ i++ i {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		} {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		} int n = calc(s); n calc(s) calc s if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			} set.contains(n) set.contains set n {
				System.out.println(i + 1);
				break;
			} System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 break; {
				set.add(n);
				s = n;
			} set.add(n) set.add set n s = n s n String args[] args static int calc(int a) {
		if (a % 2 == 0) {
			return a / 2;
		} else {
			return 3 * a + 1;
		}
	} calc {
		if (a % 2 == 0) {
			return a / 2;
		} else {
			return 3 * a + 1;
		}
	} if (a % 2 == 0) {
			return a / 2;
		} else {
			return 3 * a + 1;
		} a % 2 == 0 a % 2 a 2 0 {
			return a / 2;
		} return a / 2; a / 2 a 2 {
			return 3 * a + 1;
		} return 3 * a + 1; 3 * a + 1 3 * a 3 a 1 int a a public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int s = Integer.parseInt(str[0]);

		HashSet<Integer> set = new HashSet<>();
		set.add(s);

		for (int i = 1;; i++) {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		}
	}

	static int calc(int a) {
		if (a % 2 == 0) {
			return a / 2;
		} else {
			return 3 * a + 1;
		}
	}
} public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int s = Integer.parseInt(str[0]);

		HashSet<Integer> set = new HashSet<>();
		set.add(s);

		for (int i = 1;; i++) {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		}
	}

	static int calc(int a) {
		if (a % 2 == 0) {
			return a / 2;
		} else {
			return 3 * a + 1;
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int s = Integer.parseInt(str[0]);

		HashSet<Integer> set = new HashSet<>();
		set.add(s);

		for (int i = 1;; i++) {
			int n = calc(s);
			if (set.contains(n)) {
				System.out.println(i + 1);
				break;
			} else {
				set.add(n);
				s = n;
			}
		}
	}

	static int calc(int a) {
		if (a % 2 == 0) {
			return a / 2;
		} else {
			return 3 * a + 1;
		}
	}
}