import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static int f(int n) {
		if(n % 2 == 0) return n / 2;
		else return 3 * n + 1;
	}
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int s = sc.nextInt();
		int[] a = new int[1000010];
		int[] check = new int[1000010];
		Arrays.fill(check, 0);
		a[1] = s; check[s]++;
		for(int i = 2; i < a.length; i++) {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		}
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	static int f(int n) {
		if(n % 2 == 0) return n / 2;
		else return 3 * n + 1;
	}
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int s = sc.nextInt();
		int[] a = new int[1000010];
		int[] check = new int[1000010];
		Arrays.fill(check, 0);
		a[1] = s; check[s]++;
		for(int i = 2; i < a.length; i++) {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		}
	}
} Main static 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; n / 2 n 2 return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int s = sc.nextInt();
		int[] a = new int[1000010];
		int[] check = new int[1000010];
		Arrays.fill(check, 0);
		a[1] = s; check[s]++;
		for(int i = 2; i < a.length; i++) {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		}
	} main {
		Scanner sc=new Scanner(System.in);
		int s = sc.nextInt();
		int[] a = new int[1000010];
		int[] check = new int[1000010];
		Arrays.fill(check, 0);
		a[1] = s; check[s]++;
		for(int i = 2; i < a.length; i++) {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		}
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int[] a = new int[1000010]; a new int[1000010] 1000010 int[] check = new int[1000010]; check new int[1000010] 1000010 Arrays.fill(check, 0) Arrays.fill Arrays check 0 a[1] = s a[1] a 1 s check[s]++ check[s] check s for(int i = 2; i < a.length; i++) {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		} int i = 2; int i = 2; i 2 i < a.length i a.length a a.length i++ i++ i {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		} {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		} a[i] = f(a[i - 1]) a[i] a i f(a[i - 1]) f a[i - 1] a i - 1 i 1 check[a[i]]++ check[a[i]] check a[i] a i if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			} check[a[i]] > 1 check[a[i]] check a[i] a i 1 {
				System.out.println(i);
				break;
			} System.out.println(i) System.out.println System.out System System.out i break; String[] args args public class Main {
	static int f(int n) {
		if(n % 2 == 0) return n / 2;
		else return 3 * n + 1;
	}
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int s = sc.nextInt();
		int[] a = new int[1000010];
		int[] check = new int[1000010];
		Arrays.fill(check, 0);
		a[1] = s; check[s]++;
		for(int i = 2; i < a.length; i++) {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		}
	}
} public class Main {
	static int f(int n) {
		if(n % 2 == 0) return n / 2;
		else return 3 * n + 1;
	}
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int s = sc.nextInt();
		int[] a = new int[1000010];
		int[] check = new int[1000010];
		Arrays.fill(check, 0);
		a[1] = s; check[s]++;
		for(int i = 2; i < a.length; i++) {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		}
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static int f(int n) {
		if(n % 2 == 0) return n / 2;
		else return 3 * n + 1;
	}
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int s = sc.nextInt();
		int[] a = new int[1000010];
		int[] check = new int[1000010];
		Arrays.fill(check, 0);
		a[1] = s; check[s]++;
		for(int i = 2; i < a.length; i++) {
			a[i] = f(a[i - 1]);
			check[a[i]]++;
			if(check[a[i]] > 1) {
				System.out.println(i);
				break;
			}
		}
	}
}
