
import java.util.Scanner;

public class Main {

	public static int func(int n) {
		int res=0;
		if(n%2==0) {
			res=n/2;
		}
		else if(n%2==1) {
			res=3*n+1;
		}
		return res;
	}

	public static void main(String[] args) {
		int ans=0;
		int []a=new int[1000000];
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		a[0]=s;
		for(int i=1;i<a.length;i++) {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static int func(int n) {
		int res=0;
		if(n%2==0) {
			res=n/2;
		}
		else if(n%2==1) {
			res=3*n+1;
		}
		return res;
	}

	public static void main(String[] args) {
		int ans=0;
		int []a=new int[1000000];
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		a[0]=s;
		for(int i=1;i<a.length;i++) {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		}
		System.out.println(ans);
		sc.close();
	}
} Main public static int func(int n) {
		int res=0;
		if(n%2==0) {
			res=n/2;
		}
		else if(n%2==1) {
			res=3*n+1;
		}
		return res;
	} func {
		int res=0;
		if(n%2==0) {
			res=n/2;
		}
		else if(n%2==1) {
			res=3*n+1;
		}
		return res;
	} int res=0; res 0 if(n%2==0) {
			res=n/2;
		}
		else if(n%2==1) {
			res=3*n+1;
		} n%2==0 n%2 n 2 0 {
			res=n/2;
		} res=n/2 res n/2 n 2 if(n%2==1) {
			res=3*n+1;
		} n%2==1 n%2 n 2 1 {
			res=3*n+1;
		} res=3*n+1 res 3*n+1 3*n 3 n 1 return res; res int n n public static void main(String[] args) {
		int ans=0;
		int []a=new int[1000000];
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		a[0]=s;
		for(int i=1;i<a.length;i++) {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		}
		System.out.println(ans);
		sc.close();
	} main {
		int ans=0;
		int []a=new int[1000000];
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		a[0]=s;
		for(int i=1;i<a.length;i++) {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		}
		System.out.println(ans);
		sc.close();
	} int ans=0; ans 0 int []a=new int[1000000]; a new int[1000000] 1000000 Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int s=sc.nextInt(); s sc.nextInt() sc.nextInt sc a[0]=s a[0] a 0 s for(int i=1;i<a.length;i++) {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		} int i=1; int i=1; i 1 i<a.length i a.length a a.length i++ i++ i {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		} {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		} a[i]=func(a[i-1]) a[i] a i func(a[i-1]) func a[i-1] a i-1 i 1 for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			} int j=0; int j=0; j 0 j<i j i j++ j++ j {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			} {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			} if(a[i]==a[j]) {
					ans=i+1;
					break;
				} a[i]==a[j] a[i] a i a[j] a j {
					ans=i+1;
					break;
				} ans=i+1 ans i+1 i 1 break; if(ans!=0)break; ans!=0 ans 0 break; System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static int func(int n) {
		int res=0;
		if(n%2==0) {
			res=n/2;
		}
		else if(n%2==1) {
			res=3*n+1;
		}
		return res;
	}

	public static void main(String[] args) {
		int ans=0;
		int []a=new int[1000000];
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		a[0]=s;
		for(int i=1;i<a.length;i++) {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		}
		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static int func(int n) {
		int res=0;
		if(n%2==0) {
			res=n/2;
		}
		else if(n%2==1) {
			res=3*n+1;
		}
		return res;
	}

	public static void main(String[] args) {
		int ans=0;
		int []a=new int[1000000];
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		a[0]=s;
		for(int i=1;i<a.length;i++) {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		}
		System.out.println(ans);
		sc.close();
	}
} Main

import java.util.Scanner;

public class Main {

	public static int func(int n) {
		int res=0;
		if(n%2==0) {
			res=n/2;
		}
		else if(n%2==1) {
			res=3*n+1;
		}
		return res;
	}

	public static void main(String[] args) {
		int ans=0;
		int []a=new int[1000000];
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		a[0]=s;
		for(int i=1;i<a.length;i++) {
			a[i]=func(a[i-1]);
			for(int j=0;j<i;j++) {
				if(a[i]==a[j]) {
					ans=i+1;
					break;
				}
			}
			if(ans!=0)break;
		}
		System.out.println(ans);
		sc.close();
	}
}
