import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int ans=0;
		int a=scan.nextInt();
		List<Integer> foo = new ArrayList<Integer>();
		foo.add(a);
		for(int i=1;i!=1000000;i++) {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			}
		System.out.println(ans+1);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int ans=0;
		int a=scan.nextInt();
		List<Integer> foo = new ArrayList<Integer>();
		foo.add(a);
		for(int i=1;i!=1000000;i++) {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			}
		System.out.println(ans+1);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int ans=0;
		int a=scan.nextInt();
		List<Integer> foo = new ArrayList<Integer>();
		foo.add(a);
		for(int i=1;i!=1000000;i++) {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			}
		System.out.println(ans+1);
	} main {
		Scanner scan = new Scanner(System.in);
		int ans=0;
		int a=scan.nextInt();
		List<Integer> foo = new ArrayList<Integer>();
		foo.add(a);
		for(int i=1;i!=1000000;i++) {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			}
		System.out.println(ans+1);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int ans=0; ans 0 int a=scan.nextInt(); a scan.nextInt() scan.nextInt scan List<Integer> foo = new ArrayList<Integer>(); foo new ArrayList<Integer>() foo.add(a) foo.add foo a for(int i=1;i!=1000000;i++) {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			} int i=1; int i=1; i 1 i!=1000000 i 1000000 i++ i++ i {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			} {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			} if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				} a%2==0 a%2 a 2 0 {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			} if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        } foo.indexOf(a/2)!=-1 foo.indexOf(a/2) foo.indexOf foo a/2 a 2 -1 1 {
				ans=i;
				break;
		        } ans=i ans i break; a=a/2 a a/2 a 2 {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				} if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        } foo.indexOf(a*3+1)!=-1 foo.indexOf(a*3+1) foo.indexOf foo a*3+1 a*3 a 3 1 -1 1 {
						ans=i;
						break;
			        } ans=i ans i break; a=a*3+1 a a*3+1 a*3 a 3 1 foo.add(a) foo.add foo a System.out.println(ans+1) System.out.println System.out System System.out ans+1 ans 1 String[] args args public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int ans=0;
		int a=scan.nextInt();
		List<Integer> foo = new ArrayList<Integer>();
		foo.add(a);
		for(int i=1;i!=1000000;i++) {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			}
		System.out.println(ans+1);
	}
} public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int ans=0;
		int a=scan.nextInt();
		List<Integer> foo = new ArrayList<Integer>();
		foo.add(a);
		for(int i=1;i!=1000000;i++) {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			}
		System.out.println(ans+1);
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int ans=0;
		int a=scan.nextInt();
		List<Integer> foo = new ArrayList<Integer>();
		foo.add(a);
		for(int i=1;i!=1000000;i++) {
			if(a%2==0) {
				if(foo.indexOf(a/2)!=-1) {
				ans=i;
				break;
		        }
				a=a/2;
			}
				else {
					if(foo.indexOf(a*3+1)!=-1) {
						ans=i;
						break;
			        }
					a=a*3+1;
				}
			foo.add(a);
			}
		System.out.println(ans+1);
	}
}