import java.util.*;
public class Main {
	public static void main(String[] args){
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 1;
		int temp = N;
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(N);
		boolean flg = true;
		while(flg){
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		}
		System.out.println(cnt);		
    }
} 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 cnt = 1;
		int temp = N;
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(N);
		boolean flg = true;
		while(flg){
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		}
		System.out.println(cnt);		
    }
} Main public static void main(String[] args){
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 1;
		int temp = N;
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(N);
		boolean flg = true;
		while(flg){
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		}
		System.out.println(cnt);		
    } main {
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 1;
		int temp = N;
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(N);
		boolean flg = true;
		while(flg){
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		}
		System.out.println(cnt);		
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int cnt = 1; cnt 1 int temp = N; temp N ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() list.add(N) list.add list N boolean flg = true; flg true while(flg){
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		} flg {
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		} if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			} temp%2 == 0 temp%2 temp 2 0 {
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			} cnt++ cnt temp /=2 temp 2 if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				} list.contains(temp) list.contains list temp {
					break;
				} break; {
					list.add(temp);
				} list.add(temp) list.add list temp {
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			} cnt++ cnt temp = 3*temp +1 temp 3*temp +1 3*temp 3 temp 1 if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				} list.contains(temp) list.contains list temp {
					break;
				} break; {
					list.add(temp);
				} list.add(temp) list.add list temp System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
	public static void main(String[] args){
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 1;
		int temp = N;
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(N);
		boolean flg = true;
		while(flg){
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		}
		System.out.println(cnt);		
    }
} public class Main {
	public static void main(String[] args){
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 1;
		int temp = N;
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(N);
		boolean flg = true;
		while(flg){
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		}
		System.out.println(cnt);		
    }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 1;
		int temp = N;
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(N);
		boolean flg = true;
		while(flg){
			if(temp%2 == 0){
				cnt++;
				temp /=2;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
			}else{
				cnt++;
				temp = 3*temp +1;
				if(list.contains(temp)){
					break;
				}else{
					list.add(temp);
				}
				
			}
		}
		System.out.println(cnt);		
    }
}