import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int cur = sc.nextInt();
		int ans = 0;
		boolean used[] = new boolean[1000000 + 1];

		while(true) {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int cur = sc.nextInt();
		int ans = 0;
		boolean used[] = new boolean[1000000 + 1];

		while(true) {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int cur = sc.nextInt();
		int ans = 0;
		boolean used[] = new boolean[1000000 + 1];

		while(true) {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int cur = sc.nextInt();
		int ans = 0;
		boolean used[] = new boolean[1000000 + 1];

		while(true) {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int cur = sc.nextInt(); cur sc.nextInt() sc.nextInt sc int ans = 0; ans 0 boolean used[] = new boolean[1000000 + 1]; used new boolean[1000000 + 1] 1000000 + 1 1000000 1 while(true) {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		} true {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		} ans += 1 ans 1 if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			} used[cur] used cur {
				System.out.println(ans);
				return;
			} System.out.println(ans) System.out.println System.out System System.out ans return; {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			} used[cur] = true used[cur] used cur true cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1 cur cur % 2 == 0 ? cur / 2 : 3 * cur + 1 cur % 2 == 0 cur % 2 cur 2 0 cur / 2 cur 2 3 * cur + 1 3 * cur 3 cur 1 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int cur = sc.nextInt();
		int ans = 0;
		boolean used[] = new boolean[1000000 + 1];

		while(true) {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int cur = sc.nextInt();
		int ans = 0;
		boolean used[] = new boolean[1000000 + 1];

		while(true) {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int cur = sc.nextInt();
		int ans = 0;
		boolean used[] = new boolean[1000000 + 1];

		while(true) {
			ans += 1;
			if(used[cur]) {
				System.out.println(ans);
				return;
			} else {
				used[cur] = true;
				cur = cur % 2 == 0 ? cur / 2 : 3 * cur + 1;
			}
		}
	}
}