import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * 
 * @author morisin
 * 
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int S = sc.nextInt();
		
		int nextNum = S;
		
		Set<Integer> list = new HashSet<>();
		
		list.add(S);

		int size_before=0;
		int size_after=0;
		
		for(int i=2;i<=1000000;i++) {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		}
	}
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int S = sc.nextInt();
		
		int nextNum = S;
		
		Set<Integer> list = new HashSet<>();
		
		list.add(S);

		int size_before=0;
		int size_after=0;
		
		for(int i=2;i<=1000000;i++) {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int S = sc.nextInt();
		
		int nextNum = S;
		
		Set<Integer> list = new HashSet<>();
		
		list.add(S);

		int size_before=0;
		int size_after=0;
		
		for(int i=2;i<=1000000;i++) {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int S = sc.nextInt();
		
		int nextNum = S;
		
		Set<Integer> list = new HashSet<>();
		
		list.add(S);

		int size_before=0;
		int size_after=0;
		
		for(int i=2;i<=1000000;i++) {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int S = sc.nextInt(); S sc.nextInt() sc.nextInt sc int nextNum = S; nextNum S Set<Integer> list = new HashSet<>(); list new HashSet<>() list.add(S) list.add list S int size_before=0; size_before 0 int size_after=0; size_after 0 for(int i=2;i<=1000000;i++) {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		} int i=2; int i=2; i 2 i<=1000000 i 1000000 i++ i++ i {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		} {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		} size_before=list.size() size_before list.size() list.size list if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			} nextNum%2 == 0 nextNum%2 nextNum 2 0 {
				nextNum=nextNum/2;
				list.add(nextNum);
			} nextNum=nextNum/2 nextNum nextNum/2 nextNum 2 list.add(nextNum) list.add list nextNum {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			} nextNum=nextNum*3+1 nextNum nextNum*3+1 nextNum*3 nextNum 3 1 list.add(nextNum) list.add list nextNum size_after=list.size() size_after list.size() list.size list if(size_before==size_after) {
				System.out.println(i);
				break;
			} size_before==size_after size_before size_after {
				System.out.println(i);
				break;
			} System.out.println(i) System.out.println System.out System System.out i break; String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int S = sc.nextInt();
		
		int nextNum = S;
		
		Set<Integer> list = new HashSet<>();
		
		list.add(S);

		int size_before=0;
		int size_after=0;
		
		for(int i=2;i<=1000000;i++) {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int S = sc.nextInt();
		
		int nextNum = S;
		
		Set<Integer> list = new HashSet<>();
		
		list.add(S);

		int size_before=0;
		int size_after=0;
		
		for(int i=2;i<=1000000;i++) {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		}
	}
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * 
 * @author morisin
 * 
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int S = sc.nextInt();
		
		int nextNum = S;
		
		Set<Integer> list = new HashSet<>();
		
		list.add(S);

		int size_before=0;
		int size_after=0;
		
		for(int i=2;i<=1000000;i++) {
			size_before=list.size();
			if(nextNum%2 == 0) {
				nextNum=nextNum/2;
				list.add(nextNum);
			}else {
				nextNum=nextNum*3+1;
				list.add(nextNum);
			}
			size_after=list.size();
			
			if(size_before==size_after) {
				System.out.println(i);
				break;
			}
		}
	}
}
