import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		//変数
		//int count=0;
		boolean sw=false;
		int answer=0;
		//String answer="NO";
		List<Integer> a=new ArrayList<Integer>();
		//int af=Integer.MAX_VALUE;
		int s;
		int n=1;
		int ai=0;
		int count=0;
		//入力
		Scanner sc = new Scanner(System.in);
		s=sc.nextInt();
		//int a=sc.nextInt();
		//String S=sc.next();
		//int [][] cost =new int[N-1][2];
		
		//処理
		while(sw==false)
		{
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		}
		//System.out.println(Arrays.toString(a.toArray()));
		// 出力
		System.out.println(answer);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args)
	{
		//変数
		//int count=0;
		boolean sw=false;
		int answer=0;
		//String answer="NO";
		List<Integer> a=new ArrayList<Integer>();
		//int af=Integer.MAX_VALUE;
		int s;
		int n=1;
		int ai=0;
		int count=0;
		//入力
		Scanner sc = new Scanner(System.in);
		s=sc.nextInt();
		//int a=sc.nextInt();
		//String S=sc.next();
		//int [][] cost =new int[N-1][2];
		
		//処理
		while(sw==false)
		{
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		}
		//System.out.println(Arrays.toString(a.toArray()));
		// 出力
		System.out.println(answer);
	}
} Main public static void main(String[] args)
	{
		//変数
		//int count=0;
		boolean sw=false;
		int answer=0;
		//String answer="NO";
		List<Integer> a=new ArrayList<Integer>();
		//int af=Integer.MAX_VALUE;
		int s;
		int n=1;
		int ai=0;
		int count=0;
		//入力
		Scanner sc = new Scanner(System.in);
		s=sc.nextInt();
		//int a=sc.nextInt();
		//String S=sc.next();
		//int [][] cost =new int[N-1][2];
		
		//処理
		while(sw==false)
		{
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		}
		//System.out.println(Arrays.toString(a.toArray()));
		// 出力
		System.out.println(answer);
	} main {
		//変数
		//int count=0;
		boolean sw=false;
		int answer=0;
		//String answer="NO";
		List<Integer> a=new ArrayList<Integer>();
		//int af=Integer.MAX_VALUE;
		int s;
		int n=1;
		int ai=0;
		int count=0;
		//入力
		Scanner sc = new Scanner(System.in);
		s=sc.nextInt();
		//int a=sc.nextInt();
		//String S=sc.next();
		//int [][] cost =new int[N-1][2];
		
		//処理
		while(sw==false)
		{
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		}
		//System.out.println(Arrays.toString(a.toArray()));
		// 出力
		System.out.println(answer);
	} boolean sw=false; sw false int answer=0; answer 0 List<Integer> a=new ArrayList<Integer>(); a new ArrayList<Integer>() int s; s int n=1; n 1 int ai=0; ai 0 int count=0; count 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) s=sc.nextInt() s sc.nextInt() sc.nextInt sc while(sw==false)
		{
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		} sw==false sw false {
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		} if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			} count==0 count 0 {
				a.add(s);
				count++;
			} a.add(s) a.add a s count++ count {
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			} n=a.get(count-1) n a.get(count-1) a.get a count-1 count 1 if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				} n%2==0 n%2 n 2 0 {
					ai=n/2;
					a.add(ai);
				} ai=n/2 ai n/2 n 2 a.add(ai) a.add a ai {
					ai=3*n+1;
					a.add(ai);
				} ai=3*n+1 ai 3*n+1 3*n 3 n 1 a.add(ai) a.add a ai count++ count for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			} int i=0; int i=0; i 0 i<count-1 i count-1 count 1 i++ i++ i {
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			} {
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			} if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				} a.get(i)==ai a.get(i) a.get a i ai {
					answer=a.size();
					sw=true;
				} answer=a.size() answer a.size() a.size a sw=true sw true System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args)
	{
		//変数
		//int count=0;
		boolean sw=false;
		int answer=0;
		//String answer="NO";
		List<Integer> a=new ArrayList<Integer>();
		//int af=Integer.MAX_VALUE;
		int s;
		int n=1;
		int ai=0;
		int count=0;
		//入力
		Scanner sc = new Scanner(System.in);
		s=sc.nextInt();
		//int a=sc.nextInt();
		//String S=sc.next();
		//int [][] cost =new int[N-1][2];
		
		//処理
		while(sw==false)
		{
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		}
		//System.out.println(Arrays.toString(a.toArray()));
		// 出力
		System.out.println(answer);
	}
} public class Main {
	public static void main(String[] args)
	{
		//変数
		//int count=0;
		boolean sw=false;
		int answer=0;
		//String answer="NO";
		List<Integer> a=new ArrayList<Integer>();
		//int af=Integer.MAX_VALUE;
		int s;
		int n=1;
		int ai=0;
		int count=0;
		//入力
		Scanner sc = new Scanner(System.in);
		s=sc.nextInt();
		//int a=sc.nextInt();
		//String S=sc.next();
		//int [][] cost =new int[N-1][2];
		
		//処理
		while(sw==false)
		{
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		}
		//System.out.println(Arrays.toString(a.toArray()));
		// 出力
		System.out.println(answer);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		//変数
		//int count=0;
		boolean sw=false;
		int answer=0;
		//String answer="NO";
		List<Integer> a=new ArrayList<Integer>();
		//int af=Integer.MAX_VALUE;
		int s;
		int n=1;
		int ai=0;
		int count=0;
		//入力
		Scanner sc = new Scanner(System.in);
		s=sc.nextInt();
		//int a=sc.nextInt();
		//String S=sc.next();
		//int [][] cost =new int[N-1][2];
		
		//処理
		while(sw==false)
		{
			if(count==0)
			{
				a.add(s);
				count++;
			}else
			{
				n=a.get(count-1);
				if(n%2==0)
				{
					ai=n/2;
					a.add(ai);
				}else
				{
					ai=3*n+1;
					a.add(ai);
				}
				//System.out.println("ai="+ai);
				count++;
			}
			for(int i=0;i<count-1;i++)
			{
				if(a.get(i)==ai)
				{
					answer=a.size();
					sw=true;
				}
			}
			//System.out.println(count);
			//System.out.println(Arrays.toString(a.toArray()));
			//if(count==10)
			//{
			//	sw=true;
			//}
		}
		//System.out.println(Arrays.toString(a.toArray()));
		// 出力
		System.out.println(answer);
	}
}