import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int s = sc.nextInt();

		// 計算
		int result = 1;
		int next = s;
		HashSet<Integer> hs = new HashSet<Integer>();
		hs.add(next);
		while(true){
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		}

		// 出力
		System.out.println(result);
        
	}
} import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import java.math.BigInteger; BigInteger java.math public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int s = sc.nextInt();

		// 計算
		int result = 1;
		int next = s;
		HashSet<Integer> hs = new HashSet<Integer>();
		hs.add(next);
		while(true){
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		}

		// 出力
		System.out.println(result);
        
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int s = sc.nextInt();

		// 計算
		int result = 1;
		int next = s;
		HashSet<Integer> hs = new HashSet<Integer>();
		hs.add(next);
		while(true){
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		}

		// 出力
		System.out.println(result);
        
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int s = sc.nextInt();

		// 計算
		int result = 1;
		int next = s;
		HashSet<Integer> hs = new HashSet<Integer>();
		hs.add(next);
		while(true){
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		}

		// 出力
		System.out.println(result);
        
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int result = 1; result 1 int next = s; next s HashSet<Integer> hs = new HashSet<Integer>(); hs new HashSet<Integer>() hs.add(next) hs.add hs next while(true){
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		} true {
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		} result++ result if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    } next%2 == 0 next%2 next 2 0 {
		        next /= 2;
		    } next /= 2 next 2 {
		        next = 3 * next + 1;
		    } next = 3 * next + 1 next 3 * next + 1 3 * next 3 next 1 if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    } hs.contains(next) hs.contains hs next {
		        break;
		    } break; {
		        hs.add(next);
		    } hs.add(next) hs.add hs next System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int s = sc.nextInt();

		// 計算
		int result = 1;
		int next = s;
		HashSet<Integer> hs = new HashSet<Integer>();
		hs.add(next);
		while(true){
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		}

		// 出力
		System.out.println(result);
        
	}
} public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int s = sc.nextInt();

		// 計算
		int result = 1;
		int next = s;
		HashSet<Integer> hs = new HashSet<Integer>();
		hs.add(next);
		while(true){
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		}

		// 出力
		System.out.println(result);
        
	}
} Main
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int s = sc.nextInt();

		// 計算
		int result = 1;
		int next = s;
		HashSet<Integer> hs = new HashSet<Integer>();
		hs.add(next);
		while(true){
		    result++;
		    if(next%2 == 0){
		        next /= 2;
		    }else{
		        next = 3 * next + 1;
		    }
		    if(hs.contains(next)){
		        break;
		    }else{
		        hs.add(next);
		    }
		}

		// 出力
		System.out.println(result);
        
	}
}
