import java.util.Scanner;
import java.util.ArrayList;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(a>=0){
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		}
		System.out.println(a);
	}
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(a>=0){
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		}
		System.out.println(a);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(a>=0){
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		}
		System.out.println(a);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(a>=0){
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		}
		System.out.println(a);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() while(a>=0){
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		} a>=0 a 0 {
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		} list.add(a) list.add list a if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			} a%2==0 a%2 a 2 0 {
				a/=2;
			} a/=2 a 2 {
				a=3*a+1;
			} a=3*a+1 a 3*a+1 3*a 3 a 1 if(list.contains(a)){
				a=list.size()+1;
				break;
			} list.contains(a) list.contains list a {
				a=list.size()+1;
				break;
			} a=list.size()+1 a list.size()+1 list.size() list.size list 1 break; System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(a>=0){
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		}
		System.out.println(a);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(a>=0){
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		}
		System.out.println(a);
	}
} Main
import java.util.Scanner;
import java.util.ArrayList;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(a>=0){
			list.add(a);
			if(a%2==0){
				a/=2;
			}else{
				a=3*a+1;
			}
			if(list.contains(a)){
				a=list.size()+1;
				break;
			}
		}
		System.out.println(a);
	}
}