import java.util.*;
public class Main {
	static int modAns = (int)Math.pow(10, 9) + 7;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a = a1;
		int count = 0;
		int bucket[] = new int[1000010];
		while(true) {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		}
		System.out.println(count);
	}

	public static int func(int n) {
		return n % 2 == 0 ? n / 2 : n * 3 + 1;
	}
} import java.util.*; util.* java public class Main {
	static int modAns = (int)Math.pow(10, 9) + 7;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a = a1;
		int count = 0;
		int bucket[] = new int[1000010];
		while(true) {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		}
		System.out.println(count);
	}

	public static int func(int n) {
		return n % 2 == 0 ? n / 2 : n * 3 + 1;
	}
} Main static int modAns = (int)Math.pow(10, 9) + 7; modAns (int)Math.pow(10, 9) + 7 (int)Math.pow(10, 9) Math.pow Math 10 9 7 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a = a1;
		int count = 0;
		int bucket[] = new int[1000010];
		while(true) {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a = a1;
		int count = 0;
		int bucket[] = new int[1000010];
		while(true) {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		}
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a1 = sc.nextInt(); a1 sc.nextInt() sc.nextInt sc int a = a1; a a1 int count = 0; count 0 int bucket[] = new int[1000010]; bucket new int[1000010] 1000010 while(true) {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		} true {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		} count ++ count if(bucket[a] > 0) { break; } bucket[a] > 0 bucket[a] bucket a 0 { break; } break; bucket[a] ++ bucket[a] bucket a a = func(a) a func(a) func a System.out.println(count) System.out.println System.out System System.out count String[] args args public static int func(int n) {
		return n % 2 == 0 ? n / 2 : n * 3 + 1;
	} func {
		return n % 2 == 0 ? n / 2 : n * 3 + 1;
	} return n % 2 == 0 ? n / 2 : n * 3 + 1; n % 2 == 0 ? n / 2 : n * 3 + 1 n % 2 == 0 n % 2 n 2 0 n / 2 n 2 n * 3 + 1 n * 3 n 3 1 int n n public class Main {
	static int modAns = (int)Math.pow(10, 9) + 7;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a = a1;
		int count = 0;
		int bucket[] = new int[1000010];
		while(true) {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		}
		System.out.println(count);
	}

	public static int func(int n) {
		return n % 2 == 0 ? n / 2 : n * 3 + 1;
	}
} public class Main {
	static int modAns = (int)Math.pow(10, 9) + 7;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a = a1;
		int count = 0;
		int bucket[] = new int[1000010];
		while(true) {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		}
		System.out.println(count);
	}

	public static int func(int n) {
		return n % 2 == 0 ? n / 2 : n * 3 + 1;
	}
} Main
import java.util.*;
public class Main {
	static int modAns = (int)Math.pow(10, 9) + 7;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a = a1;
		int count = 0;
		int bucket[] = new int[1000010];
		while(true) {
			count ++;
			if(bucket[a] > 0) { break; }
			bucket[a] ++;
			a = func(a);
		}
		System.out.println(count);
	}

	public static int func(int n) {
		return n % 2 == 0 ? n / 2 : n * 3 + 1;
	}
}