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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Set<Integer> arrays=new HashSet<>();
		int cnt=1;
		int s=sc.nextInt();
		arrays.add(s);

		while(true) {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		}
	}
	public static int result(int a) {
		if(a%2==0) {
			return a/2;
		}
		return 3*a+1;
	}

} 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);
		Set<Integer> arrays=new HashSet<>();
		int cnt=1;
		int s=sc.nextInt();
		arrays.add(s);

		while(true) {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		}
	}
	public static int result(int a) {
		if(a%2==0) {
			return a/2;
		}
		return 3*a+1;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Set<Integer> arrays=new HashSet<>();
		int cnt=1;
		int s=sc.nextInt();
		arrays.add(s);

		while(true) {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		Set<Integer> arrays=new HashSet<>();
		int cnt=1;
		int s=sc.nextInt();
		arrays.add(s);

		while(true) {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Set<Integer> arrays=new HashSet<>(); arrays new HashSet<>() int cnt=1; cnt 1 int s=sc.nextInt(); s sc.nextInt() sc.nextInt sc arrays.add(s) arrays.add arrays s while(true) {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		} true {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		} cnt++ cnt s=result(s) s result(s) result s if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			} arrays.contains(s) arrays.contains arrays s {
				System.out.println(cnt);
				break;
			} System.out.println(cnt) System.out.println System.out System System.out cnt break; arrays.add(s) arrays.add arrays s String[] args args public static int result(int a) {
		if(a%2==0) {
			return a/2;
		}
		return 3*a+1;
	} result {
		if(a%2==0) {
			return a/2;
		}
		return 3*a+1;
	} if(a%2==0) {
			return a/2;
		} a%2==0 a%2 a 2 0 {
			return a/2;
		} return a/2; a/2 a 2 return 3*a+1; 3*a+1 3*a 3 a 1 int a a public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Set<Integer> arrays=new HashSet<>();
		int cnt=1;
		int s=sc.nextInt();
		arrays.add(s);

		while(true) {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		}
	}
	public static int result(int a) {
		if(a%2==0) {
			return a/2;
		}
		return 3*a+1;
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Set<Integer> arrays=new HashSet<>();
		int cnt=1;
		int s=sc.nextInt();
		arrays.add(s);

		while(true) {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		}
	}
	public static int result(int a) {
		if(a%2==0) {
			return a/2;
		}
		return 3*a+1;
	}

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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Set<Integer> arrays=new HashSet<>();
		int cnt=1;
		int s=sc.nextInt();
		arrays.add(s);

		while(true) {
			cnt++;
			s=result(s);
			if(arrays.contains(s)) {
				System.out.println(cnt);
				break;
			}
			arrays.add(s);
		}
	}
	public static int result(int a) {
		if(a%2==0) {
			return a/2;
		}
		return 3*a+1;
	}

}