import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 1;
		int i = 0;
		int ans = 0;
		int[] hairetu = new int[1000000];
		hairetu[count - 1] = n;
		while(count < 1000000){
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		}
		
		for(i = 0; i < 1000000; i++){
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		}
		System.out.println(ans + 4);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 1;
		int i = 0;
		int ans = 0;
		int[] hairetu = new int[1000000];
		hairetu[count - 1] = n;
		while(count < 1000000){
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		}
		
		for(i = 0; i < 1000000; i++){
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		}
		System.out.println(ans + 4);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 1;
		int i = 0;
		int ans = 0;
		int[] hairetu = new int[1000000];
		hairetu[count - 1] = n;
		while(count < 1000000){
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		}
		
		for(i = 0; i < 1000000; i++){
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		}
		System.out.println(ans + 4);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 1;
		int i = 0;
		int ans = 0;
		int[] hairetu = new int[1000000];
		hairetu[count - 1] = n;
		while(count < 1000000){
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		}
		
		for(i = 0; i < 1000000; i++){
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		}
		System.out.println(ans + 4);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int count = 1; count 1 int i = 0; i 0 int ans = 0; ans 0 int[] hairetu = new int[1000000]; hairetu new int[1000000] 1000000 hairetu[count - 1] = n hairetu[count - 1] hairetu count - 1 count 1 n while(count < 1000000){
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		} count < 1000000 count 1000000 {
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		} if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			} hairetu[count-1]%2 == 0 hairetu[count-1]%2 hairetu[count-1] hairetu count-1 count 1 2 0 {
				hairetu[count] = hairetu[count-1] / 2;
			} hairetu[count] = hairetu[count-1] / 2 hairetu[count] hairetu count hairetu[count-1] / 2 hairetu[count-1] hairetu count-1 count 1 2 {
				hairetu[count] = 3 * hairetu[count-1] + 1;
			} hairetu[count] = 3 * hairetu[count-1] + 1 hairetu[count] hairetu count 3 * hairetu[count-1] + 1 3 * hairetu[count-1] 3 hairetu[count-1] hairetu count-1 count 1 1 count++ count for(i = 0; i < 1000000; i++){
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		} i = 0; i = 0 i 0 i < 1000000 i 1000000 i++ i++ i {
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		} {
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		} if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			} hairetu[i] == 4 hairetu[i] hairetu i 4 {
				ans = i;
				break;
			} ans = i ans i break; if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			} hairetu[i] == 2 hairetu[i] hairetu i 2 {
				ans = i;
				break;
			} ans = i ans i break; if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			} hairetu[i] == 1 hairetu[i] hairetu i 1 {
				ans = i;
				break;
			} ans = i ans i break; {
				continue;
			} continue; System.out.println(ans + 4) System.out.println System.out System System.out ans + 4 ans 4 String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 1;
		int i = 0;
		int ans = 0;
		int[] hairetu = new int[1000000];
		hairetu[count - 1] = n;
		while(count < 1000000){
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		}
		
		for(i = 0; i < 1000000; i++){
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		}
		System.out.println(ans + 4);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 1;
		int i = 0;
		int ans = 0;
		int[] hairetu = new int[1000000];
		hairetu[count - 1] = n;
		while(count < 1000000){
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		}
		
		for(i = 0; i < 1000000; i++){
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		}
		System.out.println(ans + 4);
	}
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 1;
		int i = 0;
		int ans = 0;
		int[] hairetu = new int[1000000];
		hairetu[count - 1] = n;
		while(count < 1000000){
			if(hairetu[count-1]%2 == 0){
				hairetu[count] = hairetu[count-1] / 2;
			}
			else{
				hairetu[count] = 3 * hairetu[count-1] + 1;
			}
			count++;
		}
		
		for(i = 0; i < 1000000; i++){
			if(hairetu[i] == 4){
				ans = i;
				break;
			}
			else if(hairetu[i] == 2){
				ans = i;
				break;
			}
			else if(hairetu[i] == 1){
				ans = i;
				break;
			}
			else{
				continue;
			}
		}
		System.out.println(ans + 4);
	}
}
