import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		int[] nums = new int[1000000];
		
		nums[0] = s;
		
		for(int i=1; i<nums.length; i++) {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		}
		for(int i=0; i<nums.length; i++) {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		int[] nums = new int[1000000];
		
		nums[0] = s;
		
		for(int i=1; i<nums.length; i++) {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		}
		for(int i=0; i<nums.length; i++) {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		}
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		int[] nums = new int[1000000];
		
		nums[0] = s;
		
		for(int i=1; i<nums.length; i++) {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		}
		for(int i=0; i<nums.length; i++) {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		}
	} main {

		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		int[] nums = new int[1000000];
		
		nums[0] = s;
		
		for(int i=1; i<nums.length; i++) {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		}
		for(int i=0; i<nums.length; i++) {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int[] nums = new int[1000000]; nums new int[1000000] 1000000 nums[0] = s nums[0] nums 0 s for(int i=1; i<nums.length; i++) {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		} int i=1; int i=1; i 1 i<nums.length i nums.length nums nums.length i++ i++ i {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		} {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		} if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			} nums[i-1]%2==0 nums[i-1]%2 nums[i-1] nums i-1 i 1 2 0 {
				nums[i] = nums[i-1]/2;
			} nums[i] = nums[i-1]/2 nums[i] nums i nums[i-1]/2 nums[i-1] nums i-1 i 1 2 {
				nums[i] = 3*nums[i-1] + 1;
			} nums[i] = 3*nums[i-1] + 1 nums[i] nums i 3*nums[i-1] + 1 3*nums[i-1] 3 nums[i-1] nums i-1 i 1 1 for(int i=0; i<nums.length; i++) {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		} int i=0; int i=0; i 0 i<nums.length i nums.length nums nums.length i++ i++ i {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		} {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		} int tmp = nums[i]; tmp nums[i] nums i for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			} int j=i+1; int j=i+1; j i+1 i 1 j<nums.length j nums.length nums nums.length j++ j++ j {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			} {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			} if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				} nums[i] == nums[j] nums[i] nums i nums[j] nums j {
					System.out.println(j+1);
					return;
				} System.out.println(j+1) System.out.println System.out System System.out j+1 j 1 return; String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		int[] nums = new int[1000000];
		
		nums[0] = s;
		
		for(int i=1; i<nums.length; i++) {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		}
		for(int i=0; i<nums.length; i++) {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		}
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		int[] nums = new int[1000000];
		
		nums[0] = s;
		
		for(int i=1; i<nums.length; i++) {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		}
		for(int i=0; i<nums.length; i++) {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		int[] nums = new int[1000000];
		
		nums[0] = s;
		
		for(int i=1; i<nums.length; i++) {
			if(nums[i-1]%2==0) {
				nums[i] = nums[i-1]/2;
			}else {
				nums[i] = 3*nums[i-1] + 1;
			}
		}
		for(int i=0; i<nums.length; i++) {
			int tmp = nums[i];
			for(int j=i+1; j<nums.length; j++) {
				if(nums[i] == nums[j]) {
					System.out.println(j+1);
					return;
				}
			}
		}
	}
}
