import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = Integer.parseInt(sc.next());
		int N = 1_000_005;
		int value=s;
		int[] array = new int[N];
		HashSet<Integer> set = new HashSet<Integer>();
		array[0]=s;
		set.add(s);
		for (int i=0;i<N;i++) {
			array[i+1]=f(array[i]);
			if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			}
		}
	}

	static int f(int n) {
		if (n%2==0) {
			return n/2;
		} else {
			return n*3+1;
		}
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = Integer.parseInt(sc.next());
		int N = 1_000_005;
		int value=s;
		int[] array = new int[N];
		HashSet<Integer> set = new HashSet<Integer>();
		array[0]=s;
		set.add(s);
		for (int i=0;i<N;i++) {
			array[i+1]=f(array[i]);
			if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			}
		}
	}

	static int f(int n) {
		if (n%2==0) {
			return n/2;
		} else {
			return n*3+1;
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = Integer.parseInt(sc.next());
		int N = 1_000_005;
		int value=s;
		int[] array = new int[N];
		HashSet<Integer> set = new HashSet<Integer>();
		array[0]=s;
		set.add(s);
		for (int i=0;i<N;i++) {
			array[i+1]=f(array[i]);
			if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int s = Integer.parseInt(sc.next());
		int N = 1_000_005;
		int value=s;
		int[] array = new int[N];
		HashSet<Integer> set = new HashSet<Integer>();
		array[0]=s;
		set.add(s);
		for (int i=0;i<N;i++) {
			array[i+1]=f(array[i]);
			if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = Integer.parseInt(sc.next()); s Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int N = 1_000_005; N 1_000_005 int value=s; value s int[] array = new int[N]; array new int[N] N HashSet<Integer> set = new HashSet<Integer>(); set new HashSet<Integer>() array[0]=s array[0] array 0 s set.add(s) set.add set s for (int i=0;i<N;i++) {
			array[i+1]=f(array[i]);
			if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			}
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			array[i+1]=f(array[i]);
			if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			}
		} {
			array[i+1]=f(array[i]);
			if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			}
		} array[i+1]=f(array[i]) array[i+1] array i+1 i 1 f(array[i]) f array[i] array i if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			} set.contains(array[i+1]) set.contains set array[i+1] array i+1 i 1 {
				System.out.println(i+2);
				break;
			} System.out.println(i+2) System.out.println System.out System System.out i+2 i 2 break; {
				set.add(array[i+1]);
			} set.add(array[i+1]) set.add set array[i+1] array i+1 i 1 String[] args args static int f(int n) {
		if (n%2==0) {
			return n/2;
		} else {
			return n*3+1;
		}
	} f {
		if (n%2==0) {
			return n/2;
		} else {
			return n*3+1;
		}
	} if (n%2==0) {
			return n/2;
		} else {
			return n*3+1;
		} n%2==0 n%2 n 2 0 {
			return n/2;
		} return n/2; n/2 n 2 {
			return n*3+1;
		} return n*3+1; n*3+1 n*3 n 3 1 int n n
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = Integer.parseInt(sc.next());
		int N = 1_000_005;
		int value=s;
		int[] array = new int[N];
		HashSet<Integer> set = new HashSet<Integer>();
		array[0]=s;
		set.add(s);
		for (int i=0;i<N;i++) {
			array[i+1]=f(array[i]);
			if  (set.contains(array[i+1])) {
				System.out.println(i+2);
				break;
			} else {
				set.add(array[i+1]);
			}
		}
	}

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