import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

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

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);
		int s = sc.nextInt();

		int[] a = new int[1000000];

		a[s] = 1;
		int i, i_1 = s;
		int n = 1;
		for (;;) {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		}

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

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

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);
		int s = sc.nextInt();

		int[] a = new int[1000000];

		a[s] = 1;
		int i, i_1 = s;
		int n = 1;
		for (;;) {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		}

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} Main InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out 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 void _main(String[] args) {
		Scanner sc = new Scanner(in);
		int s = sc.nextInt();

		int[] a = new int[1000000];

		a[s] = 1;
		int i, i_1 = s;
		int n = 1;
		for (;;) {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		}

		sc.close();

	} _main {
		Scanner sc = new Scanner(in);
		int s = sc.nextInt();

		int[] a = new int[1000000];

		a[s] = 1;
		int i, i_1 = s;
		int n = 1;
		for (;;) {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		}

		sc.close();

	} Scanner sc = new Scanner(in); sc new Scanner(in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int[] a = new int[1000000]; a new int[1000000] 1000000 a[s] = 1 a[s] a s 1 int i i i_1 = s; i_1 s int n = 1; n 1 for (;;) {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		} ; {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		} {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		} i = f(i_1) i f(i_1) f i_1 n++ n if (a[i] == 1) {
				out.println(n);
				break;
			} a[i] == 1 a[i] a i 1 {
				out.println(n);
				break;
			} out.println(n) out.println out n break; a[i] = 1 a[i] a i 1 i_1 = i i_1 i sc.close() sc.close sc String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

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

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);
		int s = sc.nextInt();

		int[] a = new int[1000000];

		a[s] = 1;
		int i, i_1 = s;
		int n = 1;
		for (;;) {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		}

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

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

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);
		int s = sc.nextInt();

		int[] a = new int[1000000];

		a[s] = 1;
		int i, i_1 = s;
		int n = 1;
		for (;;) {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		}

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

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

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);
		int s = sc.nextInt();

		int[] a = new int[1000000];

		a[s] = 1;
		int i, i_1 = s;
		int n = 1;
		for (;;) {
			i = f(i_1);
			n++;
			if (a[i] == 1) {
				out.println(n);
				break;
			}
			a[i] = 1;
			i_1 = i;
		}

		sc.close();

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

}
